Commit
·
c7f5d2c
1
Parent(s):
2e6684c
Upload SemEval2014Task4.py
Browse files- SemEval2014Task4.py +12 -8
SemEval2014Task4.py
CHANGED
|
@@ -93,15 +93,18 @@ class SemEval2014Task4(datasets.GeneratorBasedBuilder):
|
|
| 93 |
'text': datasets.Value(dtype='string'),
|
| 94 |
'aspectTerms': [
|
| 95 |
{'term': datasets.Value(dtype='string'),
|
| 96 |
-
'polarity': ClassLabel(num_classes=4, names=['positive', 'negative', 'neutral', 'conflict']),
|
|
|
|
| 97 |
'from': datasets.Value(dtype='string'),
|
| 98 |
'to': datasets.Value(dtype='string')}
|
| 99 |
],
|
| 100 |
'aspectCategories': [
|
| 101 |
-
{'category': ClassLabel(num_classes=5, names=['food', 'service', 'price', 'ambience', 'anecdotes/miscellaneous']),
|
| 102 |
-
'polarity': ClassLabel(num_classes=4, names=['positive', 'negative', 'neutral', 'conflict'])}
|
|
|
|
|
|
|
| 103 |
],
|
| 104 |
-
'domain': ClassLabel(num_classes=2, names=['restaurants', 'laptops'])
|
| 105 |
}
|
| 106 |
)
|
| 107 |
elif self.config.name == "laptops":
|
|
@@ -110,11 +113,12 @@ class SemEval2014Task4(datasets.GeneratorBasedBuilder):
|
|
| 110 |
'text': datasets.Value(dtype='string'),
|
| 111 |
'aspectTerms': [
|
| 112 |
{'term': datasets.Value(dtype='string'),
|
| 113 |
-
'polarity': ClassLabel(num_classes=4, names=['positive', 'negative', 'neutral', 'conflict']),
|
|
|
|
| 114 |
'from': datasets.Value(dtype='string'),
|
| 115 |
'to': datasets.Value(dtype='string')}
|
| 116 |
],
|
| 117 |
-
'domain': ClassLabel(num_classes=2, names=['restaurants', 'laptops'])
|
| 118 |
}
|
| 119 |
)
|
| 120 |
return datasets.DatasetInfo(
|
|
@@ -182,12 +186,12 @@ class SemEval2014Task4(datasets.GeneratorBasedBuilder):
|
|
| 182 |
"text": text,
|
| 183 |
"aspectTerms": aspectTerms,
|
| 184 |
"aspectCategories": aspectCategories,
|
| 185 |
-
"domain": self.config.name,
|
| 186 |
}
|
| 187 |
elif self.config.name == 'laptops':
|
| 188 |
yield id_, {
|
| 189 |
"sentenceId": sentenceId,
|
| 190 |
"text": text,
|
| 191 |
"aspectTerms": aspectTerms,
|
| 192 |
-
"domain": self.config.name,
|
| 193 |
}
|
|
|
|
| 93 |
'text': datasets.Value(dtype='string'),
|
| 94 |
'aspectTerms': [
|
| 95 |
{'term': datasets.Value(dtype='string'),
|
| 96 |
+
# 'polarity': ClassLabel(num_classes=4, names=['positive', 'negative', 'neutral', 'conflict']),
|
| 97 |
+
'polarity': datasets.Value(dtype='string'),
|
| 98 |
'from': datasets.Value(dtype='string'),
|
| 99 |
'to': datasets.Value(dtype='string')}
|
| 100 |
],
|
| 101 |
'aspectCategories': [
|
| 102 |
+
# {'category': ClassLabel(num_classes=5, names=['food', 'service', 'price', 'ambience', 'anecdotes/miscellaneous']),
|
| 103 |
+
# 'polarity': ClassLabel(num_classes=4, names=['positive', 'negative', 'neutral', 'conflict'])}
|
| 104 |
+
{'category': datasets.Value(dtype='string'),
|
| 105 |
+
'polarity': datasets.Value(dtype='string')}
|
| 106 |
],
|
| 107 |
+
# 'domain': ClassLabel(num_classes=2, names=['restaurants', 'laptops'])
|
| 108 |
}
|
| 109 |
)
|
| 110 |
elif self.config.name == "laptops":
|
|
|
|
| 113 |
'text': datasets.Value(dtype='string'),
|
| 114 |
'aspectTerms': [
|
| 115 |
{'term': datasets.Value(dtype='string'),
|
| 116 |
+
# 'polarity': ClassLabel(num_classes=4, names=['positive', 'negative', 'neutral', 'conflict']),
|
| 117 |
+
'polarity': datasets.Value(dtype='string'),
|
| 118 |
'from': datasets.Value(dtype='string'),
|
| 119 |
'to': datasets.Value(dtype='string')}
|
| 120 |
],
|
| 121 |
+
# 'domain': ClassLabel(num_classes=2, names=['restaurants', 'laptops'])
|
| 122 |
}
|
| 123 |
)
|
| 124 |
return datasets.DatasetInfo(
|
|
|
|
| 186 |
"text": text,
|
| 187 |
"aspectTerms": aspectTerms,
|
| 188 |
"aspectCategories": aspectCategories,
|
| 189 |
+
# "domain": self.config.name,
|
| 190 |
}
|
| 191 |
elif self.config.name == 'laptops':
|
| 192 |
yield id_, {
|
| 193 |
"sentenceId": sentenceId,
|
| 194 |
"text": text,
|
| 195 |
"aspectTerms": aspectTerms,
|
| 196 |
+
# "domain": self.config.name,
|
| 197 |
}
|