commit a5d57fbc693b560a5f72e7f3cf28622f4469f560 Author: Gabriela Pałka Date: Fri Apr 3 16:56:09 2020 +0200 Add plot.py diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8978767 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:latest + +RUN apt update -y && apt install -y make +RUN apt install -y git +RUN apt install -y gcc +RUN apt install -y python3 +RUN python3 -m pip install -U matplotlib +RUN gcc --version +RUN apt install -y build-essential +RUN git clone https://github.com/usnistgov/SCTK.git +WORKDIR SCTK +RUN make config && make all && make check && make install && make doc +ENV PATH=$PATH:/SCTK/bin +ENV LANG C.UTF-8 +ENV LC_ALL C.UTF-8 \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..4531444 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,20 @@ +pipeline { + agent { dockerfile true } + stages { + stage('CopyArtifacts') { + steps { + copyArtifacts filter: 'wer.txt, srr.txt', fingerprintArtifacts: true, projectName: 's407599-metrics' + } + } + stage('Shell script') { + steps { + sh label: '', script: './script.sh' + } + } + stage('ArchiveArtifacts') { + steps { + archiveArtifacts 'plot.png' + } + } + } +} diff --git a/plot.py b/plot.py new file mode 100755 index 0000000..823f325 --- /dev/null +++ b/plot.py @@ -0,0 +1,18 @@ +import matplotlib.pyplot as plt + +if __name__ == '__main__': + wer = [] + srr = [] + + with open('wer.txt', 'r') as w, open('srr.txt') as s: + for line in w: + wer.append(float(line.strip())) + for line in s: + srr.append(float(line.strip())) + + fig, ax = plt.subplots() + ax.plot(list(range(1, len(wer) + 1)), wer, label='word error rate') + ax.plot(list(range(1, len(srr) + 1)), srr, label='sentence recognition rate') + ax.set_title("WER and SRR") + ax.legend() + plt.savefig('plot.png') diff --git a/script.sh b/script.sh new file mode 100755 index 0000000..f8b396f --- /dev/null +++ b/script.sh @@ -0,0 +1,5 @@ +#/bin/bash + +tail n -50 wer.txt > tmp && mv tmp wer.txt +tail n -50 srr.txt > tmp && mv tmp srr.txt +python3 plot.py