This commit is contained in:
Kuba Kowalczyk 2019-05-07 13:15:50 +02:00
parent e3ac62d7de
commit a061359a3e
2 changed files with 1 additions and 2 deletions

View File

@ -3,4 +3,4 @@ awk 'BEGIN { FS="\t" } {print gensub("^\\*\\*", "\\\\**", "g", $2) "\t(sp1_"NR")
awk 'BEGIN { FS="\t" } {print gensub("^\\*\\*", "\\\\**", "g", $3) "\t(sp1_"NR")"}' wikiniews_results.tsv > hypothesis.trn
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout >> results.txt
python extract.py
mv results.tsv wikiniews_results.tsv
mv result.tsv wikiniews_results.tsv

View File

@ -11,7 +11,6 @@ with open("results.txt", "r", encoding='utf-8') as ins:
deletes = int(re.findall('\d+', line)[2])
inserts = int(re.findall('\d+', line)[3])
war = (substitutions+deletes+inserts)/(substitutions+deletes+correct)
print(correct, substitutions, deletes, inserts)
wars.append(war)
if substitutions==0 and deletes==0 and inserts==0:
corrects = corrects + 1