Change txt to tsv
This commit is contained in:
parent
eadd0a1790
commit
5267345501
Can't render this file because it is too large.
|
@ -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
6
run.py
@ -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')
|
||||
|
||||
|
Can't render this file because it is too large.
|
Loading…
Reference in New Issue
Block a user