Update SemEval2015Task12NLTK.py
Browse files- SemEval2015Task12NLTK.py +5 -6
SemEval2015Task12NLTK.py
CHANGED
|
@@ -89,11 +89,11 @@ class SemEval2015Task12NLTK(datasets.GeneratorBasedBuilder):
|
|
| 89 |
'target': datasets.Value(dtype='string'),
|
| 90 |
'to': datasets.Value(dtype='string')}
|
| 91 |
],
|
| 92 |
-
'tokens':
|
| 93 |
-
'ATESP_BIEOS_tags':
|
| 94 |
-
'ATESP_BIO_tags':
|
| 95 |
-
'ATE_BIEOS_tags':
|
| 96 |
-
'ATE_BIO_tags':
|
| 97 |
|
| 98 |
'domain': datasets.Value(dtype='string'),
|
| 99 |
'reviewId': datasets.Value(dtype='string'),
|
|
@@ -177,7 +177,6 @@ class SemEvalXMLDataset():
|
|
| 177 |
}
|
| 178 |
Opinions.append(opinionDict)
|
| 179 |
|
| 180 |
-
Opinions.sort(key=lambda x: int(x["from"]))
|
| 181 |
# 从小到大排序
|
| 182 |
example = {
|
| 183 |
"text": text,
|
|
|
|
| 89 |
'target': datasets.Value(dtype='string'),
|
| 90 |
'to': datasets.Value(dtype='string')}
|
| 91 |
],
|
| 92 |
+
'tokens': datasets.Sequence(datasets.Value(dtype='string')),
|
| 93 |
+
'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'])),
|
| 94 |
+
'ATESP_BIO_tags': datasets.Sequence(datasets.ClassLabel(num_classes=7, names=['B-NEG', 'B-NEU', 'B-POS', 'I-NEG', 'I-NEU', 'I-POS', 'O'])),
|
| 95 |
+
'ATE_BIEOS_tags': datasets.Sequence(datasets.ClassLabel(num_classes=5, names=['B', 'I', 'E', 'O', 'S'])),
|
| 96 |
+
'ATE_BIO_tags': datasets.Sequence(datasets.ClassLabel(num_classes=3, names=['B', 'I', 'O'])),
|
| 97 |
|
| 98 |
'domain': datasets.Value(dtype='string'),
|
| 99 |
'reviewId': datasets.Value(dtype='string'),
|
|
|
|
| 177 |
}
|
| 178 |
Opinions.append(opinionDict)
|
| 179 |
|
|
|
|
| 180 |
# 从小到大排序
|
| 181 |
example = {
|
| 182 |
"text": text,
|