Update SemEval2016Task5NLTK.py
Browse files- SemEval2016Task5NLTK.py +5 -6
SemEval2016Task5NLTK.py
CHANGED
|
@@ -101,11 +101,11 @@ class SemEval2016Task5NLTK(datasets.GeneratorBasedBuilder):
|
|
| 101 |
'target': datasets.Value(dtype='string'),
|
| 102 |
'to': datasets.Value(dtype='string')}
|
| 103 |
],
|
| 104 |
-
'tokens':
|
| 105 |
-
'ATESP_BIEOS_tags':
|
| 106 |
-
'ATESP_BIO_tags':
|
| 107 |
-
'ATE_BIEOS_tags':
|
| 108 |
-
'ATE_BIO_tags':
|
| 109 |
|
| 110 |
'domain': datasets.Value(dtype='string'),
|
| 111 |
'reviewId': datasets.Value(dtype='string'),
|
|
@@ -196,7 +196,6 @@ class SemEvalXMLDataset():
|
|
| 196 |
}
|
| 197 |
Opinions.append(opinionDict)
|
| 198 |
|
| 199 |
-
Opinions.sort(key=lambda x: int(x["from"]))
|
| 200 |
# 从小到大排序
|
| 201 |
example = {
|
| 202 |
"text": text,
|
|
|
|
| 101 |
'target': datasets.Value(dtype='string'),
|
| 102 |
'to': datasets.Value(dtype='string')}
|
| 103 |
],
|
| 104 |
+
'tokens': datasets.Sequence(datasets.Value(dtype='string')),
|
| 105 |
+
'ATESP_BIEOS_tags': datasets.Sequence(datasets.ClassLabel(num_classes=13, names=['B-NEG', 'B-NEU', 'B-POS', 'I-NEG', 'I-NEU', 'I-POS', 'E-NEG', 'E-NEU', 'E-POS', 'S-NEG', 'S-NEU', 'S-POS', 'O'])),
|
| 106 |
+
'ATESP_BIO_tags': datasets.Sequence(datasets.ClassLabel(num_classes=7, names=['B-NEG', 'B-NEU', 'B-POS', 'I-NEG', 'I-NEU', 'I-POS', 'O'])),
|
| 107 |
+
'ATE_BIEOS_tags': datasets.Sequence(datasets.ClassLabel(num_classes=5, names=['B', 'I', 'E', 'O', 'S'])),
|
| 108 |
+
'ATE_BIO_tags': datasets.Sequence(datasets.ClassLabel(num_classes=3, names=['B', 'I', 'O'])),
|
| 109 |
|
| 110 |
'domain': datasets.Value(dtype='string'),
|
| 111 |
'reviewId': datasets.Value(dtype='string'),
|
|
|
|
| 196 |
}
|
| 197 |
Opinions.append(opinionDict)
|
| 198 |
|
|
|
|
| 199 |
# 从小到大排序
|
| 200 |
example = {
|
| 201 |
"text": text,
|