Fixed malformed examples

This commit is contained in:
s443930 2022-05-28 16:44:54 +02:00
parent b3f8dd40f2
commit 483fb9837c
7 changed files with 252527 additions and 103393 deletions

149134
dev0_predicted Normal file

File diff suppressed because it is too large Load Diff

BIN
model_ireland_news.vw Normal file

Binary file not shown.

View File

@ -1,7 +1,7 @@
import inout as io
def generateChooChoo(data, target, categories):
data = [x[2].replace('\n', '') for x in io.read(data)]
data = [x[2].replace('\n', '').replace(':', '') for x in io.read(data)]
target = [x[0].replace('\n', '') for x in io.read(target)]
if categories == {}:
@ -14,7 +14,7 @@ def generateChooChoo(data, target, categories):
return {'data': data, 'target': target}, categories
def predictFuture(test):
data = [x[2].replace('\n', '') for x in io.read(test + '/in.tsv')]
data = [x[2].replace('\n', '').replace(':', '') for x in io.read(test + '/in.tsv')]
with open('vw_ireland_news_' + test, 'w', encoding='utf-8') as f:
for text in data:
f.write('1 |text ' + text + '\n')
@ -34,4 +34,4 @@ if __name__ == '__main__':
f_targets.write(str(categories[target] + 1) + '\n')
predictFuture('test-A')
predictFuture('test-B')
predictFuture('test-B')

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff