init
Browse files
experiments/model_predict_ner.py
CHANGED
@@ -75,11 +75,7 @@ class NER:
|
|
75 |
def get_prediction(self, export_dir: str, batch_size: int):
|
76 |
os.makedirs(export_dir, exist_ok=True)
|
77 |
for test_split in ["test_1", "test_2", "test_3", "test_4"]:
|
78 |
-
|
79 |
-
|
80 |
-
# TODO: check the data format and fix the predict function accordingly
|
81 |
-
data = self.dataset[test_split]
|
82 |
-
predictions = self.predict(data["text"], batch_size)
|
83 |
with open(f"{export_dir}/{test_split}.jsonl", "w") as f:
|
84 |
f.write("\n".join([json.dumps(i) for i in predictions]))
|
85 |
|
|
|
75 |
def get_prediction(self, export_dir: str, batch_size: int):
|
76 |
os.makedirs(export_dir, exist_ok=True)
|
77 |
for test_split in ["test_1", "test_2", "test_3", "test_4"]:
|
78 |
+
predictions = self.predict(self.tokenized_datasets[test_split], batch_size)
|
|
|
|
|
|
|
|
|
79 |
with open(f"{export_dir}/{test_split}.jsonl", "w") as f:
|
80 |
f.write("\n".join([json.dumps(i) for i in predictions]))
|
81 |
|