From bf2149485c55f5af7d6db4984ed405d00acfa822 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 26 Sep 2019 19:52:47 +0300 Subject: Include sentence embedding usage --- sentence_embedding.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sentence_embedding.py') diff --git a/sentence_embedding.py b/sentence_embedding.py index 2ac6720..842fae7 100644 --- a/sentence_embedding.py +++ b/sentence_embedding.py @@ -103,10 +103,13 @@ def main(args): result = zip(row_ind, col_ind) hit_at_one = len([x for x, y in result if x == y]) + p_at_one = hit_at_one / instances percentage = hit_at_one / instances * 100 if not batch: - print(f"{hit_at_one} definitions have been matched correctly") + print(f"{paradigm} - semb on {source_lang} - {target_lang}") + print(f"P @ 1: {p_at_one}") + print(f"{percentage} {instances} definitions") if batch: fields = [ @@ -159,7 +162,7 @@ if __name__ == "__main__": parser.add_argument( "-n", "--instances", - help="number of instances in each language to retrieve", + help="number of instances in each language to use", default=1000, type=int, ) @@ -167,7 +170,7 @@ if __name__ == "__main__": "-b", "--batch", action="store_true", - help="running in batch (store results in csv) or" + help="running in batch (store results in csv) or " + "running a single instance (output the results)", ) parser.add_argument( -- cgit v1.2.3-70-g09d2