Fix filenames
This commit is contained in:
parent
b7dccf6cb3
commit
e0a0eb770b
@ -7,6 +7,6 @@ categories = {0: 'news', 1: 'sport', 2: 'opinion',
|
||||
|
||||
if __name__ == '__main__':
|
||||
for file in files:
|
||||
predicted = io.read(file + '/out')
|
||||
predicted = [categories[round(float(x))] for x in predicted]
|
||||
predicted = io.read(file + '-out')
|
||||
predicted = [categories[round(float(x))-1] for x in predicted]
|
||||
io.write(predicted, file + '/out.tsv')
|
||||
|
8
main.sh
8
main.sh
@ -1,6 +1,6 @@
|
||||
python3 wockyWoad.py
|
||||
vw --oaa 7 train/vw-in -f vw.model
|
||||
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-B-in -p test-B/out --quiet
|
||||
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 test-A-in -p test-A-out --quiet
|
||||
vw -i vw.model -t test-B-in -p test-B-out --quiet
|
||||
python3 decode.py
|
||||
|
@ -33,7 +33,7 @@ def predictFuture(test):
|
||||
if __name__ == '__main__':
|
||||
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']):
|
||||
f.write(str(target + 1) + text + '\n')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user