bugfix emojis
Browse files- super_tweet_eval.py +5 -2
super_tweet_eval.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
import json
|
3 |
import datasets
|
4 |
|
5 |
-
_VERSION = "0.1.
|
6 |
_SUPER_TWEET_EVAL_CITATION = """TBA"""
|
7 |
_SUPER_TWEET_EVAL_DESCRIPTION = """TBA"""
|
8 |
_TWEET_TOPIC_DESCRIPTION = """
|
@@ -294,7 +294,10 @@ class SuperTweetEval(datasets.GeneratorBasedBuilder):
|
|
294 |
features['text_end'] = datasets.Value("int32")
|
295 |
features['gold_label_binary'] = datasets.Value("int32")
|
296 |
if self.config.name == "tweet_emoji":
|
297 |
-
|
|
|
|
|
|
|
298 |
label_classes = f.readlines()
|
299 |
label_classes = [x.strip('\n') for x in label_classes]
|
300 |
features['gold_label'] = datasets.features.ClassLabel(names=label_classes)
|
|
|
2 |
import json
|
3 |
import datasets
|
4 |
|
5 |
+
_VERSION = "0.1.39"
|
6 |
_SUPER_TWEET_EVAL_CITATION = """TBA"""
|
7 |
_SUPER_TWEET_EVAL_DESCRIPTION = """TBA"""
|
8 |
_TWEET_TOPIC_DESCRIPTION = """
|
|
|
294 |
features['text_end'] = datasets.Value("int32")
|
295 |
features['gold_label_binary'] = datasets.Value("int32")
|
296 |
if self.config.name == "tweet_emoji":
|
297 |
+
# download class mapping
|
298 |
+
dl_manager = datasets.utils.download_manager.DownloadManager()
|
299 |
+
url_map = "https://huggingface.co/datasets/cardiffnlp/super_tweet_eval/resolve/main/data/tweet_emoji/map.txt"
|
300 |
+
with open(dl_manager.download(url_map)) as f:
|
301 |
label_classes = f.readlines()
|
302 |
label_classes = [x.strip('\n') for x in label_classes]
|
303 |
features['gold_label'] = datasets.features.ClassLabel(names=label_classes)
|