Datasets:
parquet-converter
commited on
Commit
•
0f91056
1
Parent(s):
eab3f6e
Update parquet files
Browse files- .gitattributes +0 -27
- README.md +0 -420
- dataset_infos.json +0 -1
- plain_text/wmt20_mlqe_task3-test.parquet +3 -0
- plain_text/wmt20_mlqe_task3-train.parquet +3 -0
- plain_text/wmt20_mlqe_task3-validation.parquet +3 -0
- wmt20_mlqe_task3.py +0 -280
.gitattributes
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
-
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,420 +0,0 @@
|
|
1 |
-
---
|
2 |
-
pretty_name: WMT20 - MultiLingual Quality Estimation (MLQE) Task3
|
3 |
-
annotations_creators:
|
4 |
-
- expert-generated
|
5 |
-
- machine-generated
|
6 |
-
language_creators:
|
7 |
-
- found
|
8 |
-
language:
|
9 |
-
- en
|
10 |
-
- fr
|
11 |
-
license:
|
12 |
-
- unknown
|
13 |
-
multilinguality:
|
14 |
-
- translation
|
15 |
-
size_categories:
|
16 |
-
- 1K<n<10K
|
17 |
-
source_datasets:
|
18 |
-
- extended|amazon_us_reviews
|
19 |
-
task_categories:
|
20 |
-
- translation
|
21 |
-
task_ids: []
|
22 |
-
paperswithcode_id: null
|
23 |
-
dataset_info:
|
24 |
-
features:
|
25 |
-
- name: document_id
|
26 |
-
dtype: string
|
27 |
-
- name: source_segments
|
28 |
-
sequence: string
|
29 |
-
- name: source_tokenized
|
30 |
-
sequence: string
|
31 |
-
- name: mt_segments
|
32 |
-
sequence: string
|
33 |
-
- name: mt_tokenized
|
34 |
-
sequence: string
|
35 |
-
- name: annotations
|
36 |
-
sequence:
|
37 |
-
- name: segment_id
|
38 |
-
sequence: int32
|
39 |
-
- name: annotation_start
|
40 |
-
sequence: int32
|
41 |
-
- name: annotation_length
|
42 |
-
sequence: int32
|
43 |
-
- name: severity
|
44 |
-
dtype:
|
45 |
-
class_label:
|
46 |
-
names:
|
47 |
-
0: minor
|
48 |
-
1: major
|
49 |
-
2: critical
|
50 |
-
- name: severity_weight
|
51 |
-
dtype: float32
|
52 |
-
- name: category
|
53 |
-
dtype:
|
54 |
-
class_label:
|
55 |
-
names:
|
56 |
-
0: Addition
|
57 |
-
1: Agreement
|
58 |
-
2: Ambiguous Translation
|
59 |
-
3: Capitalization
|
60 |
-
4: Character Encoding
|
61 |
-
5: Company Terminology
|
62 |
-
6: Date/Time
|
63 |
-
7: Diacritics
|
64 |
-
8: Duplication
|
65 |
-
9: False Friend
|
66 |
-
10: Grammatical Register
|
67 |
-
11: Hyphenation
|
68 |
-
12: Inconsistency
|
69 |
-
13: Lexical Register
|
70 |
-
14: Lexical Selection
|
71 |
-
15: Named Entity
|
72 |
-
16: Number
|
73 |
-
17: Omitted Auxiliary Verb
|
74 |
-
18: Omitted Conjunction
|
75 |
-
19: Omitted Determiner
|
76 |
-
20: Omitted Preposition
|
77 |
-
21: Omitted Pronoun
|
78 |
-
22: Orthography
|
79 |
-
23: Other POS Omitted
|
80 |
-
24: Over-translation
|
81 |
-
25: Overly Literal
|
82 |
-
26: POS
|
83 |
-
27: Punctuation
|
84 |
-
28: Shouldn't Have Been Translated
|
85 |
-
29: Shouldn't have been translated
|
86 |
-
30: Spelling
|
87 |
-
31: Tense/Mood/Aspect
|
88 |
-
32: Under-translation
|
89 |
-
33: Unidiomatic
|
90 |
-
34: Unintelligible
|
91 |
-
35: Unit Conversion
|
92 |
-
36: Untranslated
|
93 |
-
37: Whitespace
|
94 |
-
38: Word Order
|
95 |
-
39: Wrong Auxiliary Verb
|
96 |
-
40: Wrong Conjunction
|
97 |
-
41: Wrong Determiner
|
98 |
-
42: Wrong Language Variety
|
99 |
-
43: Wrong Preposition
|
100 |
-
44: Wrong Pronoun
|
101 |
-
- name: token_annotations
|
102 |
-
sequence:
|
103 |
-
- name: segment_id
|
104 |
-
sequence: int32
|
105 |
-
- name: first_token
|
106 |
-
sequence: int32
|
107 |
-
- name: last_token
|
108 |
-
sequence: int32
|
109 |
-
- name: token_after_gap
|
110 |
-
sequence: int32
|
111 |
-
- name: severity
|
112 |
-
dtype:
|
113 |
-
class_label:
|
114 |
-
names:
|
115 |
-
0: minor
|
116 |
-
1: major
|
117 |
-
2: critical
|
118 |
-
- name: category
|
119 |
-
dtype:
|
120 |
-
class_label:
|
121 |
-
names:
|
122 |
-
0: Addition
|
123 |
-
1: Agreement
|
124 |
-
2: Ambiguous Translation
|
125 |
-
3: Capitalization
|
126 |
-
4: Character Encoding
|
127 |
-
5: Company Terminology
|
128 |
-
6: Date/Time
|
129 |
-
7: Diacritics
|
130 |
-
8: Duplication
|
131 |
-
9: False Friend
|
132 |
-
10: Grammatical Register
|
133 |
-
11: Hyphenation
|
134 |
-
12: Inconsistency
|
135 |
-
13: Lexical Register
|
136 |
-
14: Lexical Selection
|
137 |
-
15: Named Entity
|
138 |
-
16: Number
|
139 |
-
17: Omitted Auxiliary Verb
|
140 |
-
18: Omitted Conjunction
|
141 |
-
19: Omitted Determiner
|
142 |
-
20: Omitted Preposition
|
143 |
-
21: Omitted Pronoun
|
144 |
-
22: Orthography
|
145 |
-
23: Other POS Omitted
|
146 |
-
24: Over-translation
|
147 |
-
25: Overly Literal
|
148 |
-
26: POS
|
149 |
-
27: Punctuation
|
150 |
-
28: Shouldn't Have Been Translated
|
151 |
-
29: Shouldn't have been translated
|
152 |
-
30: Spelling
|
153 |
-
31: Tense/Mood/Aspect
|
154 |
-
32: Under-translation
|
155 |
-
33: Unidiomatic
|
156 |
-
34: Unintelligible
|
157 |
-
35: Unit Conversion
|
158 |
-
36: Untranslated
|
159 |
-
37: Whitespace
|
160 |
-
38: Word Order
|
161 |
-
39: Wrong Auxiliary Verb
|
162 |
-
40: Wrong Conjunction
|
163 |
-
41: Wrong Determiner
|
164 |
-
42: Wrong Language Variety
|
165 |
-
43: Wrong Preposition
|
166 |
-
44: Wrong Pronoun
|
167 |
-
- name: token_index
|
168 |
-
sequence:
|
169 |
-
sequence:
|
170 |
-
sequence: int32
|
171 |
-
- name: total_words
|
172 |
-
dtype: int32
|
173 |
-
config_name: plain_text
|
174 |
-
splits:
|
175 |
-
- name: train
|
176 |
-
num_bytes: 10762355
|
177 |
-
num_examples: 1448
|
178 |
-
- name: test
|
179 |
-
num_bytes: 745260
|
180 |
-
num_examples: 180
|
181 |
-
- name: validation
|
182 |
-
num_bytes: 1646596
|
183 |
-
num_examples: 200
|
184 |
-
download_size: 3534634
|
185 |
-
dataset_size: 13154211
|
186 |
-
---
|
187 |
-
|
188 |
-
# Dataset Card for WMT20 - MultiLingual Quality Estimation (MLQE) Task3
|
189 |
-
|
190 |
-
## Table of Contents
|
191 |
-
- [Dataset Description](#dataset-description)
|
192 |
-
- [Dataset Summary](#dataset-summary)
|
193 |
-
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
194 |
-
- [Languages](#languages)
|
195 |
-
- [Dataset Structure](#dataset-structure)
|
196 |
-
- [Data Instances](#data-instances)
|
197 |
-
- [Data Fields](#data-fields)
|
198 |
-
- [Data Splits](#data-splits)
|
199 |
-
- [Dataset Creation](#dataset-creation)
|
200 |
-
- [Curation Rationale](#curation-rationale)
|
201 |
-
- [Source Data](#source-data)
|
202 |
-
- [Annotations](#annotations)
|
203 |
-
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
204 |
-
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
205 |
-
- [Social Impact of Dataset](#social-impact-of-dataset)
|
206 |
-
- [Discussion of Biases](#discussion-of-biases)
|
207 |
-
- [Other Known Limitations](#other-known-limitations)
|
208 |
-
- [Additional Information](#additional-information)
|
209 |
-
- [Dataset Curators](#dataset-curators)
|
210 |
-
- [Licensing Information](#licensing-information)
|
211 |
-
- [Citation Information](#citation-information)
|
212 |
-
- [Contributions](#contributions)
|
213 |
-
|
214 |
-
## Dataset Description
|
215 |
-
|
216 |
-
- **Homepage:** [WMT20 Quality Estimation Shared Task](http://www.statmt.org/wmt20/quality-estimation-task.html)
|
217 |
-
- **Repository**: [Github repository](https://github.com/deep-spin/deep-spin.github.io/tree/master/docs/data/wmt2020_qe)
|
218 |
-
- **Paper:** *Not available*
|
219 |
-
|
220 |
-
### Dataset Summary
|
221 |
-
|
222 |
-
From the homepage:
|
223 |
-
|
224 |
-
*This shared task (part of WMT20) will build on its previous editions to further examine automatic methods for estimating the quality of neural machine translation output at run-time, without relying on reference translations. As in previous years, we cover estimation at various levels. Important elements introduced this year include: a new task where sentences are annotated with Direct Assessment (DA) scores instead of labels based on post-editing; a new multilingual sentence-level dataset mainly from Wikipedia articles, where the source articles can be retrieved for document-wide context; the availability of NMT models to explore system-internal information for the task.*
|
225 |
-
|
226 |
-
*The goal of this task 3 is to predict document-level quality scores as well as fine-grained annotations.*
|
227 |
-
|
228 |
-
*Each document has a product title and its description, and is annotated for translation errors according to the MQM framework. Each error annotation has:*
|
229 |
-
- ***Word span(s).*** *Errors may consist of one or more words, not necessarily contiguous.*
|
230 |
-
- ***Severity.*** *An error can be minor (if it doesn't lead to a loss of meaning and it doesn't confuse or mislead the user), major (if it changes the meaning) or critical (if it changes the meaning and carry any type of implication, or could be seen as offensive).*
|
231 |
-
- ***Type.*** *A label specifying the error type, such as wrong word order, missing words, agreement, etc. They may provide additional information, but systems don't need to predict them.*
|
232 |
-
|
233 |
-
### Supported Tasks and Leaderboards
|
234 |
-
|
235 |
-
From the homepage:
|
236 |
-
|
237 |
-
*Submissions will be evaluated as in Task 1, in terms of Pearson's correlation between the true and predicted MQM document-level scores. Additionally, the predicted annotations will be evaluated in terms of their F1 scores with respect to the gold annotations. The [official evaluation scripts](https://github.com/sheffieldnlp/qe-eval-scripts) are available.*
|
238 |
-
|
239 |
-
### Languages
|
240 |
-
|
241 |
-
There is a single language pair in the dataset: English (`en`) - French (`fr`).
|
242 |
-
|
243 |
-
## Dataset Structure
|
244 |
-
|
245 |
-
### Data Instances
|
246 |
-
|
247 |
-
An example looks like this:
|
248 |
-
```
|
249 |
-
{
|
250 |
-
'document_id': 'B0000568SY',
|
251 |
-
'source_segments': ['Razor Scooter Replacement Wheels Set with Bearings', 'Scooter Wheels w/Bearings-Blue'],
|
252 |
-
'source_tokenized': ['Razor Scooter Replacement Wheels Set with Bearings', 'Scooter Wheels w / Bearings-Blue'],
|
253 |
-
'mt_segments': ['Roues de rechange Razor Scooter sertie de roulements', 'Roues de scooter w/roulements-bleu'],
|
254 |
-
'mt_tokenized': ['Roues de rechange Razor Scooter sertie de roulements', 'Roues de scooter w / roulements-bleu'],
|
255 |
-
'annotations': {
|
256 |
-
'segment_id': [[0], [1], [1], [0, 0], [0], [1], [1]],
|
257 |
-
'annotation_start': [[42], [19], [9], [0, 32], [9], [17], [30]],
|
258 |
-
'annotation_length': [[10], [10], [7], [5, 6], [8], [1], [4]],
|
259 |
-
'severity': [0, 0, 0, 0, 0, 1, 0],
|
260 |
-
'severity_weight': [1.0, 1.0, 1.0, 1.0, 1.0, 5.0, 1.0]
|
261 |
-
'category': [3, 3, 3, 1, 3, 36, 3],
|
262 |
-
},
|
263 |
-
'token_annotations': {
|
264 |
-
'category': [3, 3, 3, 1, 3, 36, 3],
|
265 |
-
'first_token': [[7], [5], [2], [0, 5], [2], [3], [5]],
|
266 |
-
'last_token': [[7], [5], [2], [0, 5], [2], [3], [5]],
|
267 |
-
'segment_id': [[0], [1], [1], [0, 0], [0], [1], [1]],
|
268 |
-
'severity': [0, 0, 0, 0, 0, 1, 0],
|
269 |
-
'token_after_gap': [[-1], [-1], [-1], [-1, -1], [-1], [-1], [-1]]
|
270 |
-
},
|
271 |
-
'token_index': [[[0, 5], [6, 2], [9, 8], [18, 5], [24, 7], [32, 6], [39, 2], [42, 10]], [[0, 5], [6, 2], [9, 7], [17, 1], [18, 1], [19, 15]]],
|
272 |
-
'total_words': 16
|
273 |
-
}
|
274 |
-
```
|
275 |
-
|
276 |
-
### Data Fields
|
277 |
-
|
278 |
-
- `document_id`: the document id (name of the folder).
|
279 |
-
- `source_segments`: the original source text, one sentence per line (i.e. per element of the list).
|
280 |
-
- `source_tokenized`: a tokenized version of `source_segments`.
|
281 |
-
- `mt_segments`: the original machine-translated text, one sentence per line (i.e. per element of the list).
|
282 |
-
- `mt_tokenized`: a tokenized version of `mt_segments`. Default value is `[]` when this information is not available (it happens 3 times in the train set: `B0001BW0PQ`, `B0001GS19U` and `B000A6SMJ0`).
|
283 |
-
- `annotations`: error annotations for the document. Each item of the list corresponds to an error annotation, which in turn may contain one or more error spans. Error fields are encoded in a dictionary. In the case of a multi-span error, multiple starting positions and lengths are encoded in the list. Note that these positions points to `mt.segments`, not `mt_tokenized`.
|
284 |
-
- `segment_id`: List of list of integers. Id of each error.
|
285 |
-
- `annotation_start`: List of list of integers. Start of each error.
|
286 |
-
- `annotation_length`: List of list of intergers. Length of each error.
|
287 |
-
- `severity`: List of one hot. Severity category of each error.
|
288 |
-
- `severity_weight`: List of floats. Severity weight of each error.
|
289 |
-
- `category`: List of one hot. Category of each error. See the 45 categories in `_ANNOTATION_CATEGORIES_MAPPING`.
|
290 |
-
- `token_annotations`: tokenized version of `annotations`. Each error span that contains one or more tokens has a "first token" and "last token". Again, multi-span errors have their first and last tokens encoded in a list. When a span is over a gap between two tokens, the "first" and "last" positions are `-1` (encoded as `-` in the original data), and instead the `token_after_gap` column points to the token immediately after the gap. In case of a gap occurring at the end of the sentence, this value will be equal to the number of tokens.
|
291 |
-
- `segment_id`: List of list of integers. Id of each error.
|
292 |
-
- `first_token`: List of list of integers. Start of each error.
|
293 |
-
- `last_token`: List of list of intergers. End of each error.
|
294 |
-
- `token_after_gap`: List of list of integers. Token after gap of each error.
|
295 |
-
- `severity`: List of one hot. Severity category of each error.
|
296 |
-
- `category`: List of one hot. Category of each error. See the 45 categories in `_ANNOTATION_CATEGORIES_MAPPING`.
|
297 |
-
- `token_index`: a mapping of tokens to their start and ending positions in `mt_segments`. For each token, a start and end value are encoded in a list of length 2, and all tokens represent one item in the list.
|
298 |
-
- `total_words`: total number of words in the document
|
299 |
-
|
300 |
-
```
|
301 |
-
_ANNOTATION_CATEGORIES_MAPPING = {
|
302 |
-
0: 'Addition',
|
303 |
-
1: 'Agreement',
|
304 |
-
2: 'Ambiguous Translation',
|
305 |
-
3: 'Capitalization',
|
306 |
-
4: 'Character Encoding',
|
307 |
-
5: 'Company Terminology',
|
308 |
-
6: 'Date/Time',
|
309 |
-
7: 'Diacritics',
|
310 |
-
8: 'Duplication',
|
311 |
-
9: 'False Friend',
|
312 |
-
10: 'Grammatical Register',
|
313 |
-
11: 'Hyphenation',
|
314 |
-
12: 'Inconsistency',
|
315 |
-
13: 'Lexical Register',
|
316 |
-
14: 'Lexical Selection',
|
317 |
-
15: 'Named Entity',
|
318 |
-
16: 'Number',
|
319 |
-
17: 'Omitted Auxiliary Verb',
|
320 |
-
18: 'Omitted Conjunction',
|
321 |
-
19: 'Omitted Determiner',
|
322 |
-
20: 'Omitted Preposition',
|
323 |
-
21: 'Omitted Pronoun',
|
324 |
-
22: 'Orthography',
|
325 |
-
23: 'Other POS Omitted',
|
326 |
-
24: 'Over-translation',
|
327 |
-
25: 'Overly Literal',
|
328 |
-
26: 'POS',
|
329 |
-
27: 'Punctuation',
|
330 |
-
28: "Shouldn't Have Been Translated",
|
331 |
-
29: "Shouldn't have been translated",
|
332 |
-
30: 'Spelling',
|
333 |
-
31: 'Tense/Mood/Aspect',
|
334 |
-
32: 'Under-translation',
|
335 |
-
33: 'Unidiomatic',
|
336 |
-
34: 'Unintelligible',
|
337 |
-
35: 'Unit Conversion',
|
338 |
-
36: 'Untranslated',
|
339 |
-
37: 'Whitespace',
|
340 |
-
38: 'Word Order',
|
341 |
-
39: 'Wrong Auxiliary Verb',
|
342 |
-
40: 'Wrong Conjunction',
|
343 |
-
41: 'Wrong Determiner',
|
344 |
-
42: 'Wrong Language Variety',
|
345 |
-
43: 'Wrong Preposition',
|
346 |
-
44: 'Wrong Pronoun'
|
347 |
-
}
|
348 |
-
```
|
349 |
-
|
350 |
-
### Data Splits
|
351 |
-
|
352 |
-
The dataset contains 1,448 documents for training, 200 documents for validation and 180 for (blind) test (all English-French).
|
353 |
-
|
354 |
-
## Dataset Creation
|
355 |
-
|
356 |
-
### Curation Rationale
|
357 |
-
|
358 |
-
The data is dervied from the [Amazon Product Reviews dataset](http://jmcauley.ucsd.edu/data/amazon/).
|
359 |
-
|
360 |
-
### Source Data
|
361 |
-
|
362 |
-
[More Information Needed]
|
363 |
-
|
364 |
-
#### Initial Data Collection and Normalization
|
365 |
-
|
366 |
-
[More Information Needed]
|
367 |
-
|
368 |
-
#### Who are the source language producers?
|
369 |
-
|
370 |
-
[More Information Needed]
|
371 |
-
|
372 |
-
### Annotations
|
373 |
-
|
374 |
-
[More Information Needed]
|
375 |
-
|
376 |
-
#### Annotation process
|
377 |
-
|
378 |
-
[More Information Needed]
|
379 |
-
|
380 |
-
#### Who are the annotators?
|
381 |
-
|
382 |
-
[More Information Needed]
|
383 |
-
|
384 |
-
### Personal and Sensitive Information
|
385 |
-
|
386 |
-
[More Information Needed]
|
387 |
-
|
388 |
-
## Considerations for Using the Data
|
389 |
-
|
390 |
-
### Social Impact of Dataset
|
391 |
-
|
392 |
-
[More Information Needed]
|
393 |
-
|
394 |
-
### Discussion of Biases
|
395 |
-
|
396 |
-
[More Information Needed]
|
397 |
-
|
398 |
-
### Other Known Limitations
|
399 |
-
|
400 |
-
[More Information Needed]
|
401 |
-
|
402 |
-
## Additional Information
|
403 |
-
|
404 |
-
### Dataset Curators
|
405 |
-
|
406 |
-
[More Information Needed]
|
407 |
-
|
408 |
-
### Licensing Information
|
409 |
-
|
410 |
-
Unknown
|
411 |
-
|
412 |
-
### Citation Information
|
413 |
-
|
414 |
-
```
|
415 |
-
Not available.
|
416 |
-
```
|
417 |
-
|
418 |
-
### Contributions
|
419 |
-
|
420 |
-
Thanks to [@VictorSanh](https://github.com/VictorSanh) for adding this dataset.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"plain_text": {"description": "This shared task (part of WMT20) will build on its previous editions\nto further examine automatic methods for estimating the quality\nof neural machine translation output at run-time, without relying\non reference translations. As in previous years, we cover estimation\nat various levels. Important elements introduced this year include: a new\ntask where sentences are annotated with Direct Assessment (DA)\nscores instead of labels based on post-editing; a new multilingual\nsentence-level dataset mainly from Wikipedia articles, where the\nsource articles can be retrieved for document-wide context; the\navailability of NMT models to explore system-internal information for the task.\n\nThe goal of this task 3 is to predict document-level quality scores as well as fine-grained annotations.\n", "citation": "\nNot available.\n", "homepage": "http://www.statmt.org/wmt20/quality-estimation-task.html", "license": "Unknown", "features": {"document_id": {"dtype": "string", "id": null, "_type": "Value"}, "source_segments": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "source_tokenized": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "mt_segments": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "mt_tokenized": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "annotations": {"feature": {"segment_id": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "annotation_start": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "annotation_length": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "severity": {"num_classes": 3, "names": ["minor", "major", "critical"], "names_file": null, "id": null, "_type": "ClassLabel"}, "severity_weight": {"dtype": "float32", "id": null, "_type": "Value"}, "category": {"num_classes": 45, "names": ["Addition", "Agreement", "Ambiguous Translation", "Capitalization", "Character Encoding", "Company Terminology", "Date/Time", "Diacritics", "Duplication", "False Friend", "Grammatical Register", "Hyphenation", "Inconsistency", "Lexical Register", "Lexical Selection", "Named Entity", "Number", "Omitted Auxiliary Verb", "Omitted Conjunction", "Omitted Determiner", "Omitted Preposition", "Omitted Pronoun", "Orthography", "Other POS Omitted", "Over-translation", "Overly Literal", "POS", "Punctuation", "Shouldn't Have Been Translated", "Shouldn't have been translated", "Spelling", "Tense/Mood/Aspect", "Under-translation", "Unidiomatic", "Unintelligible", "Unit Conversion", "Untranslated", "Whitespace", "Word Order", "Wrong Auxiliary Verb", "Wrong Conjunction", "Wrong Determiner", "Wrong Language Variety", "Wrong Preposition", "Wrong Pronoun"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "length": -1, "id": null, "_type": "Sequence"}, "token_annotations": {"feature": {"segment_id": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "first_token": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "last_token": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "token_after_gap": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "severity": {"num_classes": 3, "names": ["minor", "major", "critical"], "names_file": null, "id": null, "_type": "ClassLabel"}, "category": {"num_classes": 45, "names": ["Addition", "Agreement", "Ambiguous Translation", "Capitalization", "Character Encoding", "Company Terminology", "Date/Time", "Diacritics", "Duplication", "False Friend", "Grammatical Register", "Hyphenation", "Inconsistency", "Lexical Register", "Lexical Selection", "Named Entity", "Number", "Omitted Auxiliary Verb", "Omitted Conjunction", "Omitted Determiner", "Omitted Preposition", "Omitted Pronoun", "Orthography", "Other POS Omitted", "Over-translation", "Overly Literal", "POS", "Punctuation", "Shouldn't Have Been Translated", "Shouldn't have been translated", "Spelling", "Tense/Mood/Aspect", "Under-translation", "Unidiomatic", "Unintelligible", "Unit Conversion", "Untranslated", "Whitespace", "Word Order", "Wrong Auxiliary Verb", "Wrong Conjunction", "Wrong Determiner", "Wrong Language Variety", "Wrong Preposition", "Wrong Pronoun"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "length": -1, "id": null, "_type": "Sequence"}, "token_index": {"feature": {"feature": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "length": -1, "id": null, "_type": "Sequence"}, "length": -1, "id": null, "_type": "Sequence"}, "total_words": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "wmt20_mlqe_task3", "config_name": "plain_text", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 10762355, "num_examples": 1448, "dataset_name": "wmt20_mlqe_task3"}, "test": {"name": "test", "num_bytes": 745260, "num_examples": 180, "dataset_name": "wmt20_mlqe_task3"}, "validation": {"name": "validation", "num_bytes": 1646596, "num_examples": 200, "dataset_name": "wmt20_mlqe_task3"}}, "download_checksums": {"https://github.com/deep-spin/deep-spin.github.io/raw/master/docs/data/wmt2020_qe/qe-task3-enfr-traindev.tar.gz": {"num_bytes": 3301244, "checksum": "1511bfa2293ef307c0ef78f26b5161c85c8b842e4d21b8ed846c668ada515d26"}, "https://github.com/deep-spin/deep-spin.github.io/raw/master/docs/data/wmt2020_qe/qe-enfr-blindtest.tar.gz": {"num_bytes": 233390, "checksum": "9a95c04cd510437b4155ad621e39ff735bf63ebc526e904a563c7c267a88de72"}}, "download_size": 3534634, "post_processing_size": null, "dataset_size": 13154211, "size_in_bytes": 16688845}}
|
|
|
|
plain_text/wmt20_mlqe_task3-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:80019e22ad741bef58fa5934209cc1a5448dc4ee44de107b146e07a2fdbd40d6
|
3 |
+
size 361170
|
plain_text/wmt20_mlqe_task3-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ad65d337b99afe2710897636aed265c46627ad3bfcfed9aa7835a88dedf00a43
|
3 |
+
size 3728946
|
plain_text/wmt20_mlqe_task3-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5bf27838ce704937d08246261d2dbe4011cc9012a0ce6525847b6a1fc1672823
|
3 |
+
size 569316
|
wmt20_mlqe_task3.py
DELETED
@@ -1,280 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
-
#
|
4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
# you may not use this file except in compliance with the License.
|
6 |
-
# You may obtain a copy of the License at
|
7 |
-
#
|
8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
#
|
10 |
-
# Unless required by applicable law or agreed to in writing, software
|
11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
# See the License for the specific language governing permissions and
|
14 |
-
# limitations under the License.
|
15 |
-
"""WMT MLQE Shared task 3."""
|
16 |
-
|
17 |
-
|
18 |
-
import csv
|
19 |
-
import os
|
20 |
-
|
21 |
-
import datasets
|
22 |
-
|
23 |
-
|
24 |
-
_CITATION = """
|
25 |
-
Not available.
|
26 |
-
"""
|
27 |
-
|
28 |
-
_DESCRIPTION = """\
|
29 |
-
This shared task (part of WMT20) will build on its previous editions
|
30 |
-
to further examine automatic methods for estimating the quality
|
31 |
-
of neural machine translation output at run-time, without relying
|
32 |
-
on reference translations. As in previous years, we cover estimation
|
33 |
-
at various levels. Important elements introduced this year include: a new
|
34 |
-
task where sentences are annotated with Direct Assessment (DA)
|
35 |
-
scores instead of labels based on post-editing; a new multilingual
|
36 |
-
sentence-level dataset mainly from Wikipedia articles, where the
|
37 |
-
source articles can be retrieved for document-wide context; the
|
38 |
-
availability of NMT models to explore system-internal information for the task.
|
39 |
-
|
40 |
-
The goal of this task 3 is to predict document-level quality scores as well as fine-grained annotations.
|
41 |
-
"""
|
42 |
-
|
43 |
-
_HOMEPAGE = "http://www.statmt.org/wmt20/quality-estimation-task.html"
|
44 |
-
|
45 |
-
_LICENSE = "Unknown"
|
46 |
-
|
47 |
-
_URLs = {
|
48 |
-
"train+dev": "https://github.com/deep-spin/deep-spin.github.io/raw/master/docs/data/wmt2020_qe/qe-task3-enfr-traindev.tar.gz",
|
49 |
-
"test": "https://github.com/deep-spin/deep-spin.github.io/raw/master/docs/data/wmt2020_qe/qe-enfr-blindtest.tar.gz",
|
50 |
-
}
|
51 |
-
|
52 |
-
|
53 |
-
_ANNOTATION_CATEGORIES = [
|
54 |
-
"Addition",
|
55 |
-
"Agreement",
|
56 |
-
"Ambiguous Translation",
|
57 |
-
"Capitalization",
|
58 |
-
"Character Encoding",
|
59 |
-
"Company Terminology",
|
60 |
-
"Date/Time",
|
61 |
-
"Diacritics",
|
62 |
-
"Duplication",
|
63 |
-
"False Friend",
|
64 |
-
"Grammatical Register",
|
65 |
-
"Hyphenation",
|
66 |
-
"Inconsistency",
|
67 |
-
"Lexical Register",
|
68 |
-
"Lexical Selection",
|
69 |
-
"Named Entity",
|
70 |
-
"Number",
|
71 |
-
"Omitted Auxiliary Verb",
|
72 |
-
"Omitted Conjunction",
|
73 |
-
"Omitted Determiner",
|
74 |
-
"Omitted Preposition",
|
75 |
-
"Omitted Pronoun",
|
76 |
-
"Orthography",
|
77 |
-
"Other POS Omitted",
|
78 |
-
"Over-translation",
|
79 |
-
"Overly Literal",
|
80 |
-
"POS",
|
81 |
-
"Punctuation",
|
82 |
-
"Shouldn't Have Been Translated",
|
83 |
-
"Shouldn't have been translated",
|
84 |
-
"Spelling",
|
85 |
-
"Tense/Mood/Aspect",
|
86 |
-
"Under-translation",
|
87 |
-
"Unidiomatic",
|
88 |
-
"Unintelligible",
|
89 |
-
"Unit Conversion",
|
90 |
-
"Untranslated",
|
91 |
-
"Whitespace",
|
92 |
-
"Word Order",
|
93 |
-
"Wrong Auxiliary Verb",
|
94 |
-
"Wrong Conjunction",
|
95 |
-
"Wrong Determiner",
|
96 |
-
"Wrong Language Variety",
|
97 |
-
"Wrong Preposition",
|
98 |
-
"Wrong Pronoun",
|
99 |
-
]
|
100 |
-
|
101 |
-
|
102 |
-
class Wmt20MlqeTask3(datasets.GeneratorBasedBuilder):
|
103 |
-
"""WMT MLQE Shared task 3."""
|
104 |
-
|
105 |
-
BUILDER_CONFIGS = [
|
106 |
-
datasets.BuilderConfig(
|
107 |
-
name="plain_text",
|
108 |
-
version=datasets.Version("1.1.0"),
|
109 |
-
description="Plain text",
|
110 |
-
)
|
111 |
-
]
|
112 |
-
|
113 |
-
def _info(self):
|
114 |
-
features = datasets.Features(
|
115 |
-
{
|
116 |
-
"document_id": datasets.Value("string"),
|
117 |
-
"source_segments": datasets.Sequence(datasets.Value("string")),
|
118 |
-
"source_tokenized": datasets.Sequence(datasets.Value("string")),
|
119 |
-
"mt_segments": datasets.Sequence(datasets.Value("string")),
|
120 |
-
"mt_tokenized": datasets.Sequence(datasets.Value("string")),
|
121 |
-
"annotations": datasets.Sequence(
|
122 |
-
{
|
123 |
-
"segment_id": datasets.Sequence(datasets.Value("int32")),
|
124 |
-
"annotation_start": datasets.Sequence(datasets.Value("int32")),
|
125 |
-
"annotation_length": datasets.Sequence(datasets.Value("int32")),
|
126 |
-
"severity": datasets.ClassLabel(names=["minor", "major", "critical"]),
|
127 |
-
"severity_weight": datasets.Value("float32"),
|
128 |
-
"category": datasets.ClassLabel(names=_ANNOTATION_CATEGORIES),
|
129 |
-
}
|
130 |
-
),
|
131 |
-
"token_annotations": datasets.Sequence(
|
132 |
-
{
|
133 |
-
"segment_id": datasets.Sequence(datasets.Value("int32")),
|
134 |
-
"first_token": datasets.Sequence(datasets.Value("int32")),
|
135 |
-
"last_token": datasets.Sequence(datasets.Value("int32")),
|
136 |
-
"token_after_gap": datasets.Sequence(datasets.Value("int32")),
|
137 |
-
"severity": datasets.ClassLabel(names=["minor", "major", "critical"]),
|
138 |
-
"category": datasets.ClassLabel(names=_ANNOTATION_CATEGORIES),
|
139 |
-
}
|
140 |
-
),
|
141 |
-
"token_index": datasets.Sequence(datasets.Sequence(datasets.Sequence(datasets.Value("int32")))),
|
142 |
-
"total_words": datasets.Value("int32"),
|
143 |
-
}
|
144 |
-
)
|
145 |
-
|
146 |
-
return datasets.DatasetInfo(
|
147 |
-
description=_DESCRIPTION,
|
148 |
-
features=features,
|
149 |
-
supervised_keys=None,
|
150 |
-
homepage=_HOMEPAGE,
|
151 |
-
license=_LICENSE,
|
152 |
-
citation=_CITATION,
|
153 |
-
)
|
154 |
-
|
155 |
-
def _split_generators(self, dl_manager):
|
156 |
-
"""Returns SplitGenerators."""
|
157 |
-
downloaded_files = dl_manager.download(_URLs)
|
158 |
-
return [
|
159 |
-
datasets.SplitGenerator(
|
160 |
-
name=datasets.Split.TRAIN,
|
161 |
-
gen_kwargs={
|
162 |
-
"main_dir": "task3/train",
|
163 |
-
"split": "train",
|
164 |
-
"files": dl_manager.iter_archive(downloaded_files["train+dev"]),
|
165 |
-
},
|
166 |
-
),
|
167 |
-
datasets.SplitGenerator(
|
168 |
-
name=datasets.Split.TEST,
|
169 |
-
gen_kwargs={
|
170 |
-
"main_dir": "test-blind",
|
171 |
-
"split": "test",
|
172 |
-
"files": dl_manager.iter_archive(downloaded_files["test"]),
|
173 |
-
},
|
174 |
-
),
|
175 |
-
datasets.SplitGenerator(
|
176 |
-
name=datasets.Split.VALIDATION,
|
177 |
-
gen_kwargs={
|
178 |
-
"main_dir": "task3/dev",
|
179 |
-
"split": "dev",
|
180 |
-
"files": dl_manager.iter_archive(downloaded_files["train+dev"]),
|
181 |
-
},
|
182 |
-
),
|
183 |
-
]
|
184 |
-
|
185 |
-
def _generate_examples(self, main_dir, split, files):
|
186 |
-
"""Yields examples."""
|
187 |
-
|
188 |
-
prev_folder = None
|
189 |
-
source_segments, source_tokenized, mt_segments, mt_tokenized = [None] * 4
|
190 |
-
token_index, total_words, annotations, token_annotations = [], [], [], []
|
191 |
-
for path, f in files:
|
192 |
-
if path.startswith(main_dir):
|
193 |
-
dir_name = path.split("/")[main_dir.count("/") + 1]
|
194 |
-
folder = main_dir + "/" + dir_name
|
195 |
-
|
196 |
-
if prev_folder is not None and prev_folder != folder:
|
197 |
-
yield prev_folder, {
|
198 |
-
"document_id": os.path.basename(prev_folder),
|
199 |
-
"source_segments": source_segments,
|
200 |
-
"source_tokenized": source_tokenized,
|
201 |
-
"mt_segments": mt_segments,
|
202 |
-
"mt_tokenized": mt_tokenized,
|
203 |
-
"annotations": annotations,
|
204 |
-
"token_annotations": token_annotations,
|
205 |
-
"token_index": token_index,
|
206 |
-
"total_words": total_words,
|
207 |
-
}
|
208 |
-
source_segments, source_tokenized, mt_segments, mt_tokenized = [None] * 4
|
209 |
-
token_index, total_words, annotations, token_annotations = [], [], [], []
|
210 |
-
|
211 |
-
prev_folder = folder
|
212 |
-
|
213 |
-
source_segments_path = "/".join([folder, "source.segments"])
|
214 |
-
source_tokenized_path = "/".join([folder, "source.tokenized"])
|
215 |
-
mt_segments_path = "/".join([folder, "mt.segments"])
|
216 |
-
mt_tokenized_path = "/".join([folder, "mt.tokenized"])
|
217 |
-
total_words_path = "/".join([folder, "total_words"])
|
218 |
-
token_index_path = "/".join([folder, "token_index"])
|
219 |
-
|
220 |
-
if path == source_segments_path:
|
221 |
-
source_segments = f.read().decode("utf-8").splitlines()
|
222 |
-
elif path == source_tokenized_path:
|
223 |
-
source_tokenized = f.read().decode("utf-8").splitlines()
|
224 |
-
elif path == mt_segments_path:
|
225 |
-
mt_segments = f.read().decode("utf-8").splitlines()
|
226 |
-
elif path == mt_tokenized_path:
|
227 |
-
mt_tokenized = f.read().decode("utf-8").splitlines()
|
228 |
-
elif path == total_words_path:
|
229 |
-
total_words = f.read().decode("utf-8").splitlines()[0]
|
230 |
-
elif path == token_index_path:
|
231 |
-
token_index = [
|
232 |
-
[idx.split(" ") for idx in line.split("\t")]
|
233 |
-
for line in f.read().decode("utf-8").splitlines()
|
234 |
-
if line != ""
|
235 |
-
]
|
236 |
-
|
237 |
-
if split in ["train", "dev"]:
|
238 |
-
annotations_path = "/".join([folder, "annotations.tsv"])
|
239 |
-
token_annotations_path = "/".join([folder, "token_annotations.tsv"])
|
240 |
-
|
241 |
-
if path == annotations_path:
|
242 |
-
lines = (line.decode("utf-8") for line in f)
|
243 |
-
reader = csv.DictReader(lines, delimiter="\t")
|
244 |
-
annotations = [
|
245 |
-
{
|
246 |
-
"segment_id": row["segment_id"].split(" "),
|
247 |
-
"annotation_start": row["annotation_start"].split(" "),
|
248 |
-
"annotation_length": row["annotation_length"].split(" "),
|
249 |
-
"severity": row["severity"],
|
250 |
-
"severity_weight": row["severity_weight"],
|
251 |
-
"category": row["category"],
|
252 |
-
}
|
253 |
-
for row in reader
|
254 |
-
]
|
255 |
-
elif path == token_annotations_path:
|
256 |
-
lines = (line.decode("utf-8") for line in f)
|
257 |
-
reader = csv.DictReader(lines, delimiter="\t")
|
258 |
-
token_annotations = [
|
259 |
-
{
|
260 |
-
"segment_id": row["segment_id"].split(" "),
|
261 |
-
"first_token": row["first_token"].replace("-", "-1").split(" "),
|
262 |
-
"last_token": row["last_token"].replace("-", "-1").split(" "),
|
263 |
-
"token_after_gap": row["token_after_gap"].replace("-", "-1").split(" "),
|
264 |
-
"severity": row["severity"],
|
265 |
-
"category": row["category"],
|
266 |
-
}
|
267 |
-
for row in reader
|
268 |
-
]
|
269 |
-
if prev_folder is not None:
|
270 |
-
yield prev_folder, {
|
271 |
-
"document_id": os.path.basename(prev_folder),
|
272 |
-
"source_segments": source_segments,
|
273 |
-
"source_tokenized": source_tokenized,
|
274 |
-
"mt_segments": mt_segments,
|
275 |
-
"mt_tokenized": mt_tokenized,
|
276 |
-
"annotations": annotations,
|
277 |
-
"token_annotations": token_annotations,
|
278 |
-
"token_index": token_index,
|
279 |
-
"total_words": total_words,
|
280 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|