Datasets:
Update README.md
Browse files
README.md
CHANGED
@@ -102,53 +102,37 @@ field, while the second does not.
|
|
102 |
}
|
103 |
```
|
104 |
|
105 |
-
|
106 |
-
### Data Instances
|
107 |
-
To load datasets, you must specify a language.
|
108 |
-
|
109 |
-
|
110 |
-
### English Example
|
111 |
-
```Python
|
112 |
from datasets import load_dataset
|
113 |
|
114 |
-
dataset = load_dataset("
|
115 |
|
116 |
print(dataset)
|
117 |
# DatasetDict({
|
118 |
# train: Dataset({
|
119 |
-
# features: ['id', '
|
120 |
-
# num_rows:
|
121 |
# })
|
122 |
# })
|
123 |
-
```
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
-
dataset = load_dataset("naist-nlp/Wiki-ImageReview1.0", 'ja')
|
130 |
-
```
|
131 |
|
132 |
-
An example of the English dataset is as follows:
|
133 |
-
|
134 |
-
```JSON
|
135 |
-
{
|
136 |
-
"id": "001",
|
137 |
-
"image": <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=242x300 at 0x7F9D26ED47C0>,
|
138 |
-
"image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Ardea_picata.jpg/242px-Ardea_picata.jpg",
|
139 |
-
"genre": "Animals",
|
140 |
-
"sentence_1": "This photograph captures the...",
|
141 |
-
"sentence_2": "The photographer has done...",
|
142 |
-
"sentence_3": "While the clarity of the image is...",
|
143 |
-
"sentence_4": "I believe the image fails to...",
|
144 |
-
"sentence_5": "The photograph stunningly showcases...",
|
145 |
-
"annotator_1": [1, 3, 4, 5, 2],
|
146 |
-
"annotator_2": [3, 1, 4, 5, 2],
|
147 |
-
"annotator_3": [1, 2, 3, 4, 5],
|
148 |
-
"best_pair": ["annotator_1", "annotator_3"],
|
149 |
-
"best_pair_rho": 0.4000000059604645
|
150 |
-
}
|
151 |
-
```
|
152 |
|
153 |
|
154 |
|
|
|
102 |
}
|
103 |
```
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
from datasets import load_dataset
|
106 |
|
107 |
+
dataset = load_dataset("your-username/dataset-name", 'en')
|
108 |
|
109 |
print(dataset)
|
110 |
# DatasetDict({
|
111 |
# train: Dataset({
|
112 |
+
# features: ['id', 'title', 'conversations'],
|
113 |
+
# num_rows: X # Replace X with the actual number of rows in your dataset
|
114 |
# })
|
115 |
# })
|
|
|
116 |
|
117 |
+
# Example of accessing a single data instance
|
118 |
+
example = dataset['train'][0]
|
119 |
+
print(example)
|
120 |
+
# {
|
121 |
+
# "id": "0001_T",
|
122 |
+
# "title": "Mona Lisa",
|
123 |
+
# "conversations": [
|
124 |
+
# {
|
125 |
+
# "from": "user",
|
126 |
+
# "value": "<img src='/images/Mona Lisa.jpg'></img>\nFocus on Mona Lisa and explore the history."
|
127 |
+
# },
|
128 |
+
# {
|
129 |
+
# "from": "assistant",
|
130 |
+
# "value": "Of Leonardo da Vinci’s works, the Mona Lisa is the only portrait whose authenticity...."
|
131 |
+
# }
|
132 |
+
# ]
|
133 |
+
# }
|
134 |
|
|
|
|
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
|
138 |
|