add predicts for test-A

This commit is contained in:
jakubknczny 2021-05-12 22:11:50 +02:00
parent 7e34b7784f
commit 54d6d5c369
2 changed files with 5460 additions and 1 deletions

14
a.py
View File

@ -44,8 +44,20 @@ t_df['text'] = [stem(remove_specials(x.lower())) for x in t_df['text']]
vecs = vectorizer.transform(t_df['text'])
predict = bayes.predict(vecs)
with open('out.tsv', 'w') as f:
with open('dev-0/out.tsv', 'w') as f:
tsvf = csv.writer(f, delimiter='\n')
tsvf.writerow(predict)
score = bayes.score(vecs, tlabs)
print(score)
# ----------------------------------------------------------------------------------------------------------------------
t_df = pd.read_csv('test-A/in.tsv', sep='\t', names=['text'])
t_df['text'] = [stem(remove_specials(x.lower())) for x in t_df['text']]
vecs = vectorizer.transform(t_df['text'])
predict = bayes.predict(vecs)
with open('test-A/out.tsv', 'w') as f:
tsvf = csv.writer(f, delimiter='\n')
tsvf.writerow(predict)

5447
test-A/out.tsv Normal file

File diff suppressed because it is too large Load Diff