dongju.park
commited on
Commit
•
a8109da
1
Parent(s):
bd7e134
Update
Browse files- .DS_Store +0 -0
- data/test.tsv +2 -2
- talktalk-sentiment-210713-multi-singleturn-custom-multiturn.py +10 -6
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
data/test.tsv
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:42d99fca791cc4d2804a308a4f2775642a71997727c197812dcc7e32e3b56408
|
3 |
+
size 257727
|
talktalk-sentiment-210713-multi-singleturn-custom-multiturn.py
CHANGED
@@ -23,6 +23,7 @@ class TalktalkSentiment_210713_multi_singleturn_custom_multiturn(
|
|
23 |
names=['매우 긍정', '다소 긍정', '중립', '다소 부정', '매우 부정', '모름']),
|
24 |
"text_2": datasets.Value("string"),
|
25 |
"label_2": datasets.Value("string"),
|
|
|
26 |
}
|
27 |
),
|
28 |
supervised_keys=None,
|
@@ -57,10 +58,13 @@ class TalktalkSentiment_210713_multi_singleturn_custom_multiturn(
|
|
57 |
def _generate_examples(self, filepath):
|
58 |
with open(filepath, "r", encoding='UTF-8') as f:
|
59 |
for idx, line in enumerate(f):
|
60 |
-
|
61 |
-
|
62 |
-
yield idx, {"text": '', "label": '모름',
|
63 |
-
"text_2": str(text).strip(), "label_2": str(label).strip()}
|
64 |
-
else:
|
65 |
yield idx, {"text": text.strip(), "label": label.strip(),
|
66 |
-
"text_2": '', "label_2": ''}
|
|
|
|
|
|
|
|
|
|
|
|
23 |
names=['매우 긍정', '다소 긍정', '중립', '다소 부정', '매우 부정', '모름']),
|
24 |
"text_2": datasets.Value("string"),
|
25 |
"label_2": datasets.Value("string"),
|
26 |
+
"acc_label": datasets.Value("string")
|
27 |
}
|
28 |
),
|
29 |
supervised_keys=None,
|
58 |
def _generate_examples(self, filepath):
|
59 |
with open(filepath, "r", encoding='UTF-8') as f:
|
60 |
for idx, line in enumerate(f):
|
61 |
+
try:
|
62 |
+
text, label = line.split("\t")
|
|
|
|
|
|
|
63 |
yield idx, {"text": text.strip(), "label": label.strip(),
|
64 |
+
"text_2": '', "label_2": '', "acc_label": ''}
|
65 |
+
except:
|
66 |
+
text, label, acc_label = line.split("\t")
|
67 |
+
yield idx, {"text": '', "label": '모름',
|
68 |
+
"text_2": str(text).strip(), "label_2": str(label).strip(),
|
69 |
+
"acc_label": str(acc_label).strip()}
|
70 |
+
|