asahi417 commited on
Commit
29c5ee7
·
1 Parent(s): 9354068
Files changed (1) hide show
  1. experiments/model_predict_ner.py +1 -5
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
- data = self.tokenized_datasets[test_split]
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