diff --git a/Jenkinsfile b/Jenkinsfile index 590df80..1b5e935 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,9 +31,10 @@ pipeline { stage('Zadanie 3 - Metryki') { steps { sh 'python3 --version' - sh 'python3 ./zadanie3/sentences.py' + sh 'python3 ./zadanie3/script.py' sh 'chmod 755 ./zadanie3/trn.sh' - sh './zadanie3/trn.sh' + sh './zadanie3/trn.sh zadanie3/sentences.txt zadanie3/sentences.trn' + sh './zadanie3/trn.sh zadanie3/references.txt zadanie3/references.trn' } } } diff --git a/zadanie3/script.py b/zadanie3/script.py new file mode 100644 index 0000000..5a337de --- /dev/null +++ b/zadanie3/script.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import numpy, pandas + +input_data = pandas.read_csv('ASR-eval/wikiniews_results.tsv', encoding='utf8', error_bad_lines=False, sep='\t', header=None) +sentences = input_data[1] +references = input_data[2] + +numpy.savetxt('zadanie3/sentences.txt', sentences, '%s') +numpy.savetxt('zadanie3/references.txt', references, '%s') \ No newline at end of file diff --git a/zadanie3/sentences.py b/zadanie3/sentences.py deleted file mode 100644 index f874ed1..0000000 --- a/zadanie3/sentences.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import numpy, pandas - -input_data = pandas.read_csv('ASR-eval/wikiniews_results.tsv', encoding='latin1', error_bad_lines=False, sep='\t', header=None) -sentences = input_data[1] - -numpy.savetxt('zadanie3/sentences.txt', sentences, '%s') \ No newline at end of file diff --git a/zadanie3/trn.sh b/zadanie3/trn.sh index 28dc058..37f05ae 100644 --- a/zadanie3/trn.sh +++ b/zadanie3/trn.sh @@ -1 +1 @@ -awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < zadanie3/reference.txt > zadanie3/sentences.trn \ No newline at end of file +awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < $S1 > $S2 \ No newline at end of file