init
Browse files
experiments/model_predict_classifier.py
CHANGED
@@ -163,7 +163,7 @@ class EmojiClassification(Classifier):
|
|
163 |
|
164 |
def __init__(self, model_name: str):
|
165 |
self.dataset = load_dataset("tweettemposhift/tweet_temporal_shift", "hate_temporal")
|
166 |
-
id_to_label =
|
167 |
super().__init__(model_name, max_length=128, multi_label=False, id_to_label=id_to_label)
|
168 |
|
169 |
def get_prediction(self, export_dir: str, batch_size: int):
|
|
|
163 |
|
164 |
def __init__(self, model_name: str):
|
165 |
self.dataset = load_dataset("tweettemposhift/tweet_temporal_shift", "hate_temporal")
|
166 |
+
id_to_label = {str(k): v for k, v in enumerate(self.dataset["test"].features["gold_label"].names)}
|
167 |
super().__init__(model_name, max_length=128, multi_label=False, id_to_label=id_to_label)
|
168 |
|
169 |
def get_prediction(self, export_dir: str, batch_size: int):
|