Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bauer <horatio@gmail.com>2022-08-29 20:28:05 +0300
committerJohn Bauer <horatio@gmail.com>2022-09-01 10:38:37 +0300
commit9d8b305286bafee96594b9f40d1a22a2d7f6a3b1 (patch)
tree49a20e1a0c4305c7a69972f0d73ac5be93dabf0d
parent6dc76092ad5fe5d2aa3c9f5148c3f2e8336204d3 (diff)
Update compose_ete_results.py to allow multiple input files
-rw-r--r--stanza/utils/training/compose_ete_results.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/stanza/utils/training/compose_ete_results.py b/stanza/utils/training/compose_ete_results.py
index 82ad4393..339f76ec 100644
--- a/stanza/utils/training/compose_ete_results.py
+++ b/stanza/utils/training/compose_ete_results.py
@@ -21,13 +21,21 @@ MLAS | 72.28 | 71.87 | 72.07 | 71.94
BLEX | 73.20 | 72.79 | 73.00 | 72.86
"""
+import argparse
+
from stanza.utils.training.run_ete import RESULTS_STRING
from stanza.models.common.short_name_to_treebank import short_name_to_treebank
EXPECTED_ORDER = ["Tokens", "Sentences", "Words", "UPOS", "XPOS", "UFeats", "AllTags", "Lemmas", "UAS", "LAS", "CLAS", "MLAS", "BLEX"]
-with open("ete_full.out") as fin:
- lines = fin.readlines()
+parser = argparse.ArgumentParser()
+parser.add_argument("filenames", type=str, nargs="+", help="Which file(s) to read")
+args = parser.parse_args()
+
+lines = []
+for filename in args.filenames:
+ with open(filename) as fin:
+ lines.extend(fin.readlines())
blocks = []
index = 0