Fix filenames

This commit is contained in:
Iwona Christop 2022-05-28 21:32:36 +02:00
parent b7dccf6cb3
commit e0a0eb770b
3 changed files with 7 additions and 7 deletions

View File

@ -7,6 +7,6 @@ categories = {0: 'news', 1: 'sport', 2: 'opinion',
if __name__ == '__main__': if __name__ == '__main__':
for file in files: for file in files:
predicted = io.read(file + '/out') predicted = io.read(file + '-out')
predicted = [categories[round(float(x))] for x in predicted] predicted = [categories[round(float(x))-1] for x in predicted]
io.write(predicted, file + '/out.tsv') io.write(predicted, file + '/out.tsv')

View File

@ -1,6 +1,6 @@
python3 wockyWoad.py python3 wockyWoad.py
vw --oaa 7 train/vw-in -f vw.model vw --oaa 7 train-in -f vw.model
vw -i vw.model -t dev0-in -p dev-0/out --quiet vw -i vw.model -t dev0-in -p dev-0-out --quiet
vw -i vw.model -t test-A-in -p test-A/out --quiet vw -i vw.model -t test-A-in -p test-A-out --quiet
vw -i vw.model -t test-B-in -p test-B/out --quiet vw -i vw.model -t test-B-in -p test-B-out --quiet
python3 decode.py python3 decode.py

View File

@ -33,7 +33,7 @@ def predictFuture(test):
if __name__ == '__main__': if __name__ == '__main__':
ireland_news_train = trainingData('train/in.tsv.xz', 'train/expected.tsv.xz') ireland_news_train = trainingData('train/in.tsv.xz', 'train/expected.tsv.xz')
with open('train/vw-in', 'w', encoding='utf-8') as f: with open('train-in', 'w', encoding='utf-8') as f:
for target, text in zip(ireland_news_train['target'], ireland_news_train['data']): for target, text in zip(ireland_news_train['target'], ireland_news_train['data']):
f.write(str(target + 1) + text + '\n') f.write(str(target + 1) + text + '\n')