From 66a2145ace1fed0b2fbbd30a4f45f58d6865f9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Besnier?= Date: Fri, 3 Jun 2022 14:43:31 +0200 Subject: [PATCH 1/2] Fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f8b5759e..62064b01 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ For the CorPaR classifier, type: $ python analyze.py corpar ``` -The results in the form of preditions are written to TSV files in the folders `results/svm` and `results/corpar` respectively. To analyze them by computing edit distance and B-Cubed F-scores, we use the script `evaluate.py`: +The results in the form of predictions are written to TSV files in the folders `results/svm` and `results/corpar` respectively. To analyze them by computing edit distance and B-Cubed F-scores, we use the script `evaluate.py`: ``` $ python evaluate.py From 4e54579740015d49f8905881272083926c7d788a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Besnier?= Date: Fri, 3 Jun 2022 14:44:27 +0200 Subject: [PATCH 2/2] Added encoding="utf-8". Without it, it failed reading the file on my setup (Windows 10). --- evaluate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evaluate.py b/evaluate.py index e195636b..d063d6cc 100644 --- a/evaluate.py +++ b/evaluate.py @@ -24,7 +24,7 @@ for clf in classifiers: for pth in progressbar(list(Path("results", clf).glob("*.tsv"))[:]): - with open(pth) as f: + with open(pth, "r", encoding="utf-8") as f: res = [] for row in f: res += [[[a.strip() for a in x.split()] for x in row.split("\t")]]