From e508a430d43612dc9ea3a9625b6ad41fb775004b Mon Sep 17 00:00:00 2001 From: s407323 Date: Fri, 26 Apr 2019 15:02:00 +0200 Subject: [PATCH] use cut instead of python --- Jenkinsfile | 5 +---- zadanie3/script.py | 2 +- zadanie3/trn.sh | 7 ++++++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1b5e935..b0106a8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,11 +30,8 @@ pipeline { stage('Zadanie 3 - Metryki') { steps { - sh 'python3 --version' - sh 'python3 ./zadanie3/script.py' sh 'chmod 755 ./zadanie3/trn.sh' - sh './zadanie3/trn.sh zadanie3/sentences.txt zadanie3/sentences.trn' - sh './zadanie3/trn.sh zadanie3/references.txt zadanie3/references.trn' + sh './zadanie3/trn.sh' } } } diff --git a/zadanie3/script.py b/zadanie3/script.py index 5a337de..fd0fcd6 100644 --- a/zadanie3/script.py +++ b/zadanie3/script.py @@ -3,7 +3,7 @@ import numpy, pandas -input_data = pandas.read_csv('ASR-eval/wikiniews_results.tsv', encoding='utf8', error_bad_lines=False, sep='\t', header=None) +input_data = pandas.read_csv('ASR-eval/wikiniews_results.tsv', encoding='latin1', error_bad_lines=False, sep='\t', header=None) sentences = input_data[1] references = input_data[2] diff --git a/zadanie3/trn.sh b/zadanie3/trn.sh index 37f05ae..d6409ea 100644 --- a/zadanie3/trn.sh +++ b/zadanie3/trn.sh @@ -1 +1,6 @@ -awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < $S1 > $S2 \ No newline at end of file + +cut -f 2 ASR-eval/wikiniews_results.tsv > zadanie3/sentences.txt +cut -f 3 ASR-eval/wikiniews_results.tsv > zadanie3/references.txt + +awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < zadanie3/sentences.txt > zadanie3/sentences.trn +awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < zadanie3/references.txt > zadanie3/references.trn \ No newline at end of file