raphael0202 commited on
Commit
00f36af
·
verified ·
1 Parent(s): 24a3803

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +204 -128
README.md CHANGED
@@ -1,128 +1,204 @@
1
- ---
2
- dataset_info:
3
- features:
4
- - name: ner_tags
5
- sequence:
6
- class_label:
7
- names:
8
- '0': O
9
- '1': B-ENERGY_KJ_100G
10
- '2': I-ENERGY_KJ_100G
11
- '3': B-VITAMIN_D_SERVING
12
- '4': I-VITAMIN_D_SERVING
13
- '5': B-SODIUM_SERVING
14
- '6': I-SODIUM_SERVING
15
- '7': B-PROTEINS_SERVING
16
- '8': I-PROTEINS_SERVING
17
- '9': B-ADDED_SUGARS_SERVING
18
- '10': I-ADDED_SUGARS_SERVING
19
- '11': B-CALCIUM_SERVING
20
- '12': I-CALCIUM_SERVING
21
- '13': B-FAT_SERVING
22
- '14': I-FAT_SERVING
23
- '15': B-ENERGY_KJ_SERVING
24
- '16': I-ENERGY_KJ_SERVING
25
- '17': B-SUGARS_100G
26
- '18': I-SUGARS_100G
27
- '19': B-SATURATED_FAT_SERVING
28
- '20': I-SATURATED_FAT_SERVING
29
- '21': B-SERVING_SIZE
30
- '22': I-SERVING_SIZE
31
- '23': B-SALT_SERVING
32
- '24': I-SALT_SERVING
33
- '25': B-ENERGY_KCAL_SERVING
34
- '26': I-ENERGY_KCAL_SERVING
35
- '27': B-FAT_100G
36
- '28': I-FAT_100G
37
- '29': B-SUGARS_SERVING
38
- '30': I-SUGARS_SERVING
39
- '31': B-FIBER_SERVING
40
- '32': I-FIBER_SERVING
41
- '33': B-TRANS_FAT_SERVING
42
- '34': I-TRANS_FAT_SERVING
43
- '35': B-POTASSIUM_SERVING
44
- '36': I-POTASSIUM_SERVING
45
- '37': B-CARBOHYDRATES_100G
46
- '38': I-CARBOHYDRATES_100G
47
- '39': B-POTASSIUM_100G
48
- '40': I-POTASSIUM_100G
49
- '41': B-IRON_SERVING
50
- '42': I-IRON_SERVING
51
- '43': B-CHOLESTEROL_100G
52
- '44': I-CHOLESTEROL_100G
53
- '45': B-TRANS_FAT_100G
54
- '46': I-TRANS_FAT_100G
55
- '47': B-ADDED_SUGARS_100G
56
- '48': I-ADDED_SUGARS_100G
57
- '49': B-FIBER_100G
58
- '50': I-FIBER_100G
59
- '51': B-CALCIUM_100G
60
- '52': I-CALCIUM_100G
61
- '53': B-SODIUM_100G
62
- '54': I-SODIUM_100G
63
- '55': B-ENERGY_KCAL_100G
64
- '56': I-ENERGY_KCAL_100G
65
- '57': B-CHOLESTEROL_SERVING
66
- '58': I-CHOLESTEROL_SERVING
67
- '59': B-CARBOHYDRATES_SERVING
68
- '60': I-CARBOHYDRATES_SERVING
69
- '61': B-SALT_100G
70
- '62': I-SALT_100G
71
- '63': B-VITAMIN_D_100G
72
- '64': I-VITAMIN_D_100G
73
- '65': B-SATURATED_FAT_100G
74
- '66': I-SATURATED_FAT_100G
75
- '67': B-PROTEINS_100G
76
- '68': I-PROTEINS_100G
77
- '69': B-IRON_100G
78
- '70': I-IRON_100G
79
- - name: tokens
80
- sequence: string
81
- - name: bboxes
82
- sequence:
83
- sequence: int64
84
- - name: image
85
- dtype: image
86
- - name: meta
87
- struct:
88
- - name: barcode
89
- dtype: string
90
- - name: image_id
91
- dtype: string
92
- - name: image_url
93
- dtype: string
94
- - name: split
95
- dtype: string
96
- - name: ocr_url
97
- dtype: string
98
- - name: batch
99
- dtype: string
100
- - name: label_studio_id
101
- dtype: int64
102
- - name: checked
103
- dtype: bool
104
- - name: usda_table
105
- dtype: bool
106
- - name: nutrition_text
107
- dtype: bool
108
- - name: no_nutrition_table
109
- dtype: bool
110
- - name: comment
111
- dtype: string
112
- splits:
113
- - name: train
114
- num_bytes: 607157648.1712618
115
- num_examples: 2884
116
- - name: test
117
- num_bytes: 41894719.82873824
118
- num_examples: 199
119
- download_size: 635258020
120
- dataset_size: 649052368.0
121
- configs:
122
- - config_name: default
123
- data_files:
124
- - split: train
125
- path: data/train-*
126
- - split: test
127
- path: data/test-*
128
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ features:
4
+ - name: ner_tags
5
+ sequence:
6
+ class_label:
7
+ names:
8
+ '0': O
9
+ '1': B-ENERGY_KJ_100G
10
+ '2': I-ENERGY_KJ_100G
11
+ '3': B-VITAMIN_D_SERVING
12
+ '4': I-VITAMIN_D_SERVING
13
+ '5': B-SODIUM_SERVING
14
+ '6': I-SODIUM_SERVING
15
+ '7': B-PROTEINS_SERVING
16
+ '8': I-PROTEINS_SERVING
17
+ '9': B-ADDED_SUGARS_SERVING
18
+ '10': I-ADDED_SUGARS_SERVING
19
+ '11': B-CALCIUM_SERVING
20
+ '12': I-CALCIUM_SERVING
21
+ '13': B-FAT_SERVING
22
+ '14': I-FAT_SERVING
23
+ '15': B-ENERGY_KJ_SERVING
24
+ '16': I-ENERGY_KJ_SERVING
25
+ '17': B-SUGARS_100G
26
+ '18': I-SUGARS_100G
27
+ '19': B-SATURATED_FAT_SERVING
28
+ '20': I-SATURATED_FAT_SERVING
29
+ '21': B-SERVING_SIZE
30
+ '22': I-SERVING_SIZE
31
+ '23': B-SALT_SERVING
32
+ '24': I-SALT_SERVING
33
+ '25': B-ENERGY_KCAL_SERVING
34
+ '26': I-ENERGY_KCAL_SERVING
35
+ '27': B-FAT_100G
36
+ '28': I-FAT_100G
37
+ '29': B-SUGARS_SERVING
38
+ '30': I-SUGARS_SERVING
39
+ '31': B-FIBER_SERVING
40
+ '32': I-FIBER_SERVING
41
+ '33': B-TRANS_FAT_SERVING
42
+ '34': I-TRANS_FAT_SERVING
43
+ '35': B-POTASSIUM_SERVING
44
+ '36': I-POTASSIUM_SERVING
45
+ '37': B-CARBOHYDRATES_100G
46
+ '38': I-CARBOHYDRATES_100G
47
+ '39': B-POTASSIUM_100G
48
+ '40': I-POTASSIUM_100G
49
+ '41': B-IRON_SERVING
50
+ '42': I-IRON_SERVING
51
+ '43': B-CHOLESTEROL_100G
52
+ '44': I-CHOLESTEROL_100G
53
+ '45': B-TRANS_FAT_100G
54
+ '46': I-TRANS_FAT_100G
55
+ '47': B-ADDED_SUGARS_100G
56
+ '48': I-ADDED_SUGARS_100G
57
+ '49': B-FIBER_100G
58
+ '50': I-FIBER_100G
59
+ '51': B-CALCIUM_100G
60
+ '52': I-CALCIUM_100G
61
+ '53': B-SODIUM_100G
62
+ '54': I-SODIUM_100G
63
+ '55': B-ENERGY_KCAL_100G
64
+ '56': I-ENERGY_KCAL_100G
65
+ '57': B-CHOLESTEROL_SERVING
66
+ '58': I-CHOLESTEROL_SERVING
67
+ '59': B-CARBOHYDRATES_SERVING
68
+ '60': I-CARBOHYDRATES_SERVING
69
+ '61': B-SALT_100G
70
+ '62': I-SALT_100G
71
+ '63': B-VITAMIN_D_100G
72
+ '64': I-VITAMIN_D_100G
73
+ '65': B-SATURATED_FAT_100G
74
+ '66': I-SATURATED_FAT_100G
75
+ '67': B-PROTEINS_100G
76
+ '68': I-PROTEINS_100G
77
+ '69': B-IRON_100G
78
+ '70': I-IRON_100G
79
+ - name: tokens
80
+ sequence: string
81
+ - name: bboxes
82
+ sequence:
83
+ sequence: int64
84
+ - name: image
85
+ dtype: image
86
+ - name: meta
87
+ struct:
88
+ - name: barcode
89
+ dtype: string
90
+ - name: image_id
91
+ dtype: string
92
+ - name: image_url
93
+ dtype: string
94
+ - name: split
95
+ dtype: string
96
+ - name: ocr_url
97
+ dtype: string
98
+ - name: batch
99
+ dtype: string
100
+ - name: label_studio_id
101
+ dtype: int64
102
+ - name: checked
103
+ dtype: bool
104
+ - name: usda_table
105
+ dtype: bool
106
+ - name: nutrition_text
107
+ dtype: bool
108
+ - name: no_nutrition_table
109
+ dtype: bool
110
+ - name: comment
111
+ dtype: string
112
+ splits:
113
+ - name: train
114
+ num_bytes: 607157648.1712618
115
+ num_examples: 2884
116
+ - name: test
117
+ num_bytes: 41894719.82873824
118
+ num_examples: 199
119
+ download_size: 635258020
120
+ dataset_size: 649052368
121
+ configs:
122
+ - config_name: default
123
+ data_files:
124
+ - split: train
125
+ path: data/train-*
126
+ - split: test
127
+ path: data/test-*
128
+ license: cc-by-sa-3.0
129
+ task_categories:
130
+ - token-classification
131
+ tags:
132
+ - food
133
+ size_categories:
134
+ - 1K<n<10K
135
+ ---
136
+
137
+ # Nutrient extraction dataset
138
+
139
+ This dataset contains annotated images of nutrition tables. The goal of this dataset was to train a model to extract nutrient values from nutrition tables, as part of the Nutrisight project.
140
+ It contains ~3k samples in total (2.8k for training and 199 for testing). For more information about the project, please refer to the [nutrisight directory](https://github.com/openfoodfacts/openfoodfacts-ai/tree/develop/nutrisight) in the openfoodfacts-ai GitHub repository.
141
+
142
+ The images were collected from the Open Food Facts database, and annotated by a team of professional annotators.
143
+ The dataset is meant to be used as a training/testing dataset using LayoutLM-like models: we expect the OCR to be performed prior to prediction. The target task for this dataset is token classification: the model should assign a single label to each token in the input image.
144
+
145
+
146
+ We use the BIO tagging scheme. We only annotate the value (+ unit) of the nutrition table, not the nutrient name. All other tokens are annotated as "O".
147
+ The nutrient values can be per 100g or per serving, so we have one label type for each case, one suffixing the label with "_100g" and the other with "_SERVING".
148
+
149
+ The values are annotated with the following labels.
150
+ We removed the 'B-' and '-I' prefixes for readability, so the real number of labels is twice the number of labels listed below.
151
+
152
+ - ADDED_SUGARS_SERVING
153
+ - CALCIUM_100G
154
+ - CALCIUM_SERVING
155
+ - CARBOHYDRATES_100G
156
+ - CARBOHYDRATES_SERVING
157
+ - CHOLESTEROL_SERVING
158
+ - ENERGY_KCAL_100G
159
+ - ENERGY_KCAL_SERVING
160
+ - ENERGY_KJ_100G
161
+ - ENERGY_KJ_SERVING
162
+ - FAT_100G
163
+ - FAT_SERVING
164
+ - FIBER_100G
165
+ - FIBER_SERVING
166
+ - IRON_SERVING
167
+ - POTASSIUM_SERVING
168
+ - PROTEINS_100G
169
+ - PROTEINS_SERVING
170
+ - SALT_100G
171
+ - SALT_SERVING
172
+ - SATURATED_FAT_100G
173
+ - SATURATED_FAT_SERVING
174
+ - SERVING_SIZE
175
+ - SODIUM_100G
176
+ - SODIUM_SERVING
177
+ - SUGARS_100G
178
+ - SUGARS_SERVING
179
+ - TRANS_FAT_100G
180
+ - TRANS_FAT_SERVING
181
+ - VITAMIN_D_100G
182
+ - VITAMIN_D_SERVING
183
+
184
+ The following fields are available for each sample:
185
+
186
+ - `ner_tags`: a list of label IDs for each token in the input image. The label IDs are integers, and the mapping from label IDs to label names can be found in the parquet file metadata. It's automatically available when loading the dataset using the `datasets` library.
187
+ - `tokens`: a list of tokens in the input image. This was extracted using Google Cloud Vision API.
188
+ - `bboxes`: a list of bounding boxes for each token in the input image. The bounding boxes are in the format `[x_min, y_min, x_max, y_max]`, where `(x_min, y_min)` is the top-left corner and `(x_max, y_max)` is the bottom-right corner of the bounding box. The bounding boxes are in the same order as the tokens. The coordinates should be normalized between 1 and 1000 (excluded).
189
+ - `image`: the image.
190
+ - `meta`: a dictionary containing the following fields:
191
+ - `barcode`: the barcode of the product.
192
+ - `image_id`: the ID of the image (digit, specific to the product)
193
+ - `image_url`: the URL of the image.
194
+ - `split`: the split of the image (train, test).
195
+ - `ocr_url`: the URL of the OCR result.
196
+ - `batch`: the annotation batch (annotations were performed by batches of ~100 samples)
197
+ - `label_studio_id`: the ID of the task in Label Studio.
198
+ - `checked`: whether the annotation was checked by a second annotator.
199
+ - `usda_table`: whether the nutrition table is from a USDA-like table (as annotated by the annotators).
200
+ - `nutrition_text`: whether the nutrition table is from a text-like table (as annotated by the annotators).
201
+ - `no_nutrition_table`: whether the image contains no nutrition table (as annotated by the annotators).
202
+ - `comment`: a comment from the annotators.
203
+
204
+ The dataset (including the images) are licensed under the Creative Commons Attribution Share Alike license (CC-BY-SA 3.0).