metryki
This commit is contained in:
parent
9faa5e64ce
commit
2c6424ef3d
@ -10,6 +10,9 @@ pipeline {
|
|||||||
sh(' ./lines.sh')
|
sh(' ./lines.sh')
|
||||||
archiveArtifacts 'lines_number.txt'
|
archiveArtifacts 'lines_number.txt'
|
||||||
archiveArtifacts 'wer.txt'
|
archiveArtifacts 'wer.txt'
|
||||||
|
archiveArtifacts 'srr.txt'
|
||||||
|
archiveArtifacts 'wer.tsv'
|
||||||
|
archiveArtifacts 'wikiniews_results_with_wer.tsv'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
lines.sh
29
lines.sh
@ -1,3 +1,32 @@
|
|||||||
# zliczenie liczby linijekw pliku wikinews i zapisanie do lines_number.txt
|
# zliczenie liczby linijekw pliku wikinews i zapisanie do lines_number.txt
|
||||||
wc -l wikiniews_results.tsv > lines_number.txt
|
wc -l wikiniews_results.tsv > lines_number.txt
|
||||||
|
|
||||||
|
#utworzenie plików hypothesis i reference
|
||||||
|
#wycięcie drugiej kolumny (hipotez - wyniki rozpoznawania ASR)
|
||||||
|
cut -f2 wikiniews_results.tsv > hypothesis.txt
|
||||||
|
#wycięcie trzeciej kolumnu (referencje - poprawne zdania)
|
||||||
|
cut -f3 wikiniews_results.tsv > reference.txt
|
||||||
|
|
||||||
|
#przekształcenie plików txt na trn
|
||||||
|
awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < reference.txt > reference.trn
|
||||||
|
awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hypothesis.txt > hypothesis.trn
|
||||||
|
|
||||||
|
#przenieś i zapisz 50 obserwacji
|
||||||
|
mv wer.txt wer1.txt
|
||||||
|
mv srr.txt srr1.txt
|
||||||
|
|
||||||
|
#wyświetlanie i zapisywanie
|
||||||
|
cat wer1.txt | tail -n 49 > wer.txt
|
||||||
|
cat srr1.txt | tail -n 49 > srr.txt
|
||||||
|
|
||||||
|
#wywołanie sclite
|
||||||
|
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep Scores > scores
|
||||||
|
|
||||||
|
#hyphothesis - wyniki działania ARS
|
||||||
|
#reference - referencyjne zdania
|
||||||
|
|
||||||
|
awk 'BEGIN{OFS="\t"}{print $6, $7, $8, $9}' < scores | awk '{ print ($2 + $3 + $4)/($2 + $3 + $1) }' > wer.tsv
|
||||||
|
paste wikiniews_results.tsv wer.tsv > wikiniews_results_with_wer.tsv
|
||||||
|
|
||||||
|
awk 'BEGIN{FS=OFS="\t"}{ bad = bad + $1; all++ }END{ print bad/all }' < wer.tsv >> wer.txt
|
||||||
|
awk 'BEGIN{FS=OFS="\t"}{ if ( $1 == 0 ) good++; all++ }END{ print good/all }' < wer.tsv >> srr.txt
|
Loading…
Reference in New Issue
Block a user