diff --git a/Jenkinsfile b/Jenkinsfile index 2fe05f7..90e644b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,21 +5,13 @@ pipeline { steps { script { step ([$class: 'CopyArtifact', - projectName: 'ASR-eval', - target: 'Infra']); + projectName: 's407259-metrics', + target: 's407259-matrics-data']); sh 'git --version' sh 'git checkout' - sh 'python3 script.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' - + sh 'python3 generate_plot.py' } } } diff --git a/calculate_metrics.py b/calculate_metrics.py deleted file mode 100644 index 2e85e86..0000000 --- a/calculate_metrics.py +++ /dev/null @@ -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') diff --git a/generate_plot.py b/generate_plot.py new file mode 100644 index 0000000..c806cfe --- /dev/null +++ b/generate_plot.py @@ -0,0 +1 @@ +print('I am in') \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1f0fa05..1411a4a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -pandas -jiwer \ No newline at end of file +pandas \ No newline at end of file diff --git a/script.py b/script.py deleted file mode 100644 index d8a10f9..0000000 --- a/script.py +++ /dev/null @@ -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() \ No newline at end of file