From 79032fc1d763680b8b8655051ea14b7e1f8e184c Mon Sep 17 00:00:00 2001 From: s407323 Date: Fri, 26 Apr 2019 14:49:06 +0200 Subject: [PATCH] rename files and separate sentences and references --- Jenkinsfile | 5 +++-- zadanie3/script.py | 11 +++++++++++ zadanie3/sentences.py | 9 --------- zadanie3/trn.sh | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 zadanie3/script.py delete mode 100644 zadanie3/sentences.py 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