new plot branch

This commit is contained in:
Tomasz Łysiak 2019-05-16 10:33:28 +02:00
parent 7cd179e927
commit ec71cbfa78
5 changed files with 5 additions and 65 deletions

14
Jenkinsfile vendored
View File

@ -5,21 +5,13 @@ pipeline {
steps { steps {
script { script {
step ([$class: 'CopyArtifact', step ([$class: 'CopyArtifact',
projectName: 'ASR-eval', projectName: 's407259-metrics',
target: 'Infra']); target: 's407259-matrics-data']);
sh 'git --version' sh 'git --version'
sh 'git checkout' sh 'git checkout'
sh 'python3 script.py' sh 'python3 generate_plot.py'
archiveArtifacts artifacts: 'num_lines.txt'
sh 'sudo python3 calculate_metrics.py'
archiveArtifacts artifacts: 'wikiniews_results_with_wer.tsv'
archiveArtifacts artifacts: 'wer_mean.txt'
archiveArtifacts artifacts: 'srr.txt'
archiveArtifacts artifacts: 'historical_wer_mean.txt'
archiveArtifacts artifacts: 'historical_srr.txt'
} }
} }
} }

View File

@ -1,39 +0,0 @@
import pandas as pd
from jiwer import wer
df_data = pd.read_csv('./Infra/wikiniews_results.tsv', sep='\t', index_col=False, header=None,
skip_blank_lines=False, keep_default_na=False, names=[1,2,3,4,5])
correct_answers = 0
for index, row in df_data.iterrows():
wer_result = wer(row[2], row[3])
df_data.loc[index, 5] = wer_result
if wer_result == 0.0:
correct_answers += 1
wer_mean = df_data[5].mean()
print(wer_mean)
srr = (correct_answers*1)/len(df_data)
print(srr)
df_data.to_csv('./wikiniews_results_with_wer.tsv',sep='\t', header=None)
with open("wer_mean.txt", "w") as text_file:
text_file.write(str(df_data[5].mean()))
with open("srr.txt", "w") as text_file:
text_file.write(str(srr))
with open("historical_wer_mean.txt", "a") as text_file:
text_file.write(str(df_data[5].mean()) + '\n')
with open("historical_srr.txt", "a") as text_file:
text_file.write(str(srr) + '\n')

1
generate_plot.py Normal file
View File

@ -0,0 +1 @@
print('I am in')

View File

@ -1,2 +1 @@
pandas pandas
jiwer

View File

@ -1,13 +0,0 @@
print('starting 2')
import sys
from importlib import reload
import os
reload(sys)
num_lines = os.popen('wc -l ./Infra/wikiniews_results.tsv').read()
print('lines number')
print(num_lines)
file = open('num_lines.txt', 'w')
file.write(str(num_lines))
file.close()