Skip to content
Snippets Groups Projects
Commit 9ebeb1d7 authored by Martyna Wiącek's avatar Martyna Wiącek
Browse files

save head and separate predictions in json file by line

parent de9301ad
No related branches found
No related tags found
No related merge requests found
Pipeline #9560 passed
......@@ -57,6 +57,7 @@ class Sentence:
return json.dumps({
"tokens": [(t.token, t.lemma, t.upostag, t.xpostag, t. feats, t.head, t.deprel) for t in self.tokens],
# "sentence_embedding": self.sentence_embedding,
"head": [t.head for t in self.tokens],
"relation_distribution_hash": hash,
"path_file": str(os.path.join(save_relation_distribution_path, hash + '.npz'))
}, cls=NumpyArrayEncoder)
......
......@@ -136,7 +136,7 @@ class COMBO(predictor.Predictor):
else:
if not os.path.exists(self.save_relation_distribution_path):
os.makedirs(self.save_relation_distribution_path)
return outputs.to_json(self.save_relation_distribution_path)
return outputs.to_json(self.save_relation_distribution_path) + "\n"
@staticmethod
def _to_input_json(sentence: str):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment