rename files and separate sentences and references

This commit is contained in:
s407323 2019-04-26 14:49:06 +02:00
parent b2ba027fc9
commit 79032fc1d7
4 changed files with 15 additions and 12 deletions

5
Jenkinsfile vendored
View File

@ -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'
}
}
}

11
zadanie3/script.py Normal file
View File

@ -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')

View File

@ -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')

View File

@ -1 +1 @@
awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < zadanie3/reference.txt > zadanie3/sentences.trn
awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < $S1 > $S2