Change txt to tsv

This commit is contained in:
ulaniuk 2022-06-15 10:30:58 +02:00
parent eadd0a1790
commit 5267345501
5 changed files with 6 additions and 6 deletions

View File

Can't render this file because it is too large.

View File

@ -126,7 +126,7 @@
"metadata": {},
"outputs": [],
"source": [
"with open('dev-0/out.txt', 'w') as f:\n",
"with open('dev-0/out.tsv', 'w') as f:\n",
" for sentence in X_dev:\n",
" f.write(f'{model.predict(sentence)[0][0][9:]}\\n')\n",
"\n",
@ -139,7 +139,7 @@
"metadata": {},
"outputs": [],
"source": [
"with open('test-A/out.txt', 'w') as f:\n",
"with open('test-A/out.tsv', 'w') as f:\n",
" for sentence in X_test_A:\n",
" f.write(f'{model.predict(sentence)[0][0][9:]}\\n')\n",
"\n",
@ -152,7 +152,7 @@
"metadata": {},
"outputs": [],
"source": [
"with open('test-B/out.txt', 'w') as f:\n",
"with open('test-B/tsv.txt', 'w') as f:\n",
" for sentence in X_test_B:\n",
" f.write(f'{model.predict(sentence)[0][0][9:]}\\n')\n",
"\n",

6
run.py
View File

@ -32,19 +32,19 @@ f.close()
model = fasttext.train_supervised('train.txt')
with open('dev-0/out.txt', 'w') as f:
with open('dev-0/out.tsv', 'w') as f:
for sentence in X_dev:
f.write(f'{model.predict(sentence)[0][0][9:]}\n')
f.close()
with open('test-A/out.txt', 'w') as f:
with open('test-A/tsv.txt', 'w') as f:
for sentence in X_test_A:
f.write(f'{model.predict(sentence)[0][0][9:]}\n')
f.close()
with open('test-B/out.txt', 'w') as f:
with open('test-B/tsv.txt', 'w') as f:
for sentence in X_test_B:
f.write(f'{model.predict(sentence)[0][0][9:]}\n')

View File

Can't render this file because it is too large.