add predicts for test-A
This commit is contained in:
parent
7e34b7784f
commit
54d6d5c369
14
a.py
14
a.py
@ -44,8 +44,20 @@ t_df['text'] = [stem(remove_specials(x.lower())) for x in t_df['text']]
|
|||||||
vecs = vectorizer.transform(t_df['text'])
|
vecs = vectorizer.transform(t_df['text'])
|
||||||
|
|
||||||
predict = bayes.predict(vecs)
|
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 = csv.writer(f, delimiter='\n')
|
||||||
tsvf.writerow(predict)
|
tsvf.writerow(predict)
|
||||||
score = bayes.score(vecs, tlabs)
|
score = bayes.score(vecs, tlabs)
|
||||||
print(score)
|
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
5447
test-A/out.tsv
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user