Add plot.py
This commit is contained in:
commit
a5d57fbc69
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -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
|
20
Jenkinsfile
vendored
Normal file
20
Jenkinsfile
vendored
Normal file
@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
18
plot.py
Executable file
18
plot.py
Executable file
@ -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')
|
Loading…
Reference in New Issue
Block a user