From 10e7c4cf739af8e62a373eeef29aea409d03a068 Mon Sep 17 00:00:00 2001 From: email Date: Fri, 26 Apr 2019 15:06:39 +0200 Subject: [PATCH] WER calculated, Python added --- Dockerfile | 1 + script.sh | 2 +- solution.py | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 solution.py diff --git a/Dockerfile b/Dockerfile index bf3941c..80fe819 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ RUN apt install -y git RUN apt install -y gcc RUN gcc --version RUN apt install -y build-essential +RUN apt install python3.6 RUN git clone https://github.com/usnistgov/SCTK.git WORKDIR SCTK RUN make config && make all && make check && make install && make doc diff --git a/script.sh b/script.sh index 7aa71df..dc42d18 100644 --- a/script.sh +++ b/script.sh @@ -10,5 +10,5 @@ sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all std cat WER_SSR.txt | grep -oP '(?<=Scores: \(#C #S #D #I\) ).*' > values.txt -for i in `cat values.txt`; do c=$((($2+$3+$4)/($2+$3+$1))); echo $c ;done; > values_WER.txt +python3 solution.py diff --git a/solution.py b/solution.py new file mode 100644 index 0000000..0a669c3 --- /dev/null +++ b/solution.py @@ -0,0 +1,5 @@ +with open ('values.txt', 'r') as file: + with open ('WER_values.txt', 'w') as file_o: + for i in file: + C, S, D, I = i.strip() + file_o.write((S+D+I)/(S+D+C) + '\n')