Update CaSSA-catalan-structured-sentiment-analysis.py
Browse files
CaSSA-catalan-structured-sentiment-analysis.py
CHANGED
|
@@ -54,9 +54,16 @@ class CaSSA(datasets.GeneratorBasedBuilder):
|
|
| 54 |
features=datasets.Features(
|
| 55 |
{"sent_id": datasets.Value("string"),
|
| 56 |
"text": datasets.Value("string"),
|
| 57 |
-
"opinions":
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
homepage=_HOMEPAGE,
|
| 61 |
citation=_CITATION,
|
| 62 |
)
|
|
@@ -79,7 +86,7 @@ class CaSSA(datasets.GeneratorBasedBuilder):
|
|
| 79 |
data = [json.loads(line) for line in f]
|
| 80 |
for id_, text in enumerate(data):
|
| 81 |
yield id_, {
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
}
|
|
|
|
| 54 |
features=datasets.Features(
|
| 55 |
{"sent_id": datasets.Value("string"),
|
| 56 |
"text": datasets.Value("string"),
|
| 57 |
+
"opinions": [
|
| 58 |
+
{
|
| 59 |
+
"Source": datasets.features.Sequence(datasets.features.Sequence(datasets.Value("string"))),
|
| 60 |
+
"Target": datasets.features.Sequence(datasets.features.Sequence(datasets.Value("string"))),
|
| 61 |
+
"Polar_expression": datasets.features.Sequence(datasets.features.Sequence(datasets.Value("string"))),
|
| 62 |
+
"Polarity": datasets.Value("string"),
|
| 63 |
+
"Intensity": datasets.Value("string")
|
| 64 |
+
}
|
| 65 |
+
]
|
| 66 |
+
}),
|
| 67 |
homepage=_HOMEPAGE,
|
| 68 |
citation=_CITATION,
|
| 69 |
)
|
|
|
|
| 86 |
data = [json.loads(line) for line in f]
|
| 87 |
for id_, text in enumerate(data):
|
| 88 |
yield id_, {
|
| 89 |
+
"sent_id": text['sent_id'],
|
| 90 |
+
"text": text['text'],
|
| 91 |
+
"opinions": text["opinions"]
|
| 92 |
+
}
|