Compare commits

...

1 Commits

Author SHA1 Message Date
76d0840340 naive bayes solution 2021-05-12 14:25:10 +02:00
4 changed files with 10920 additions and 0 deletions

5452
dev-0/out.tsv Normal file

File diff suppressed because it is too large Load Diff

BIN
geval Executable file

Binary file not shown.

23
main.py Normal file
View File

@ -0,0 +1,23 @@
import pandas as pd
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline import make_pipeline
train_set = pd.read_table('train/train.tsv.gz', error_bad_lines=False, header=None)
dev_set = pd.read_table('dev-0/in.tsv', error_bad_lines=False, header=None)
test_set = pd.read_table('test-A/in.tsv', error_bad_lines=False, header=None)
X_train = train_set[1].values
y_train = train_set[0].values
X_dev = dev_set[0].values
X_test = test_set[0].values
model = make_pipeline(TfidfVectorizer(), MultinomialNB())
model.fit(X_train, y_train)
dev_prediction = model.predict(X_dev)
test_prediction = model.predict(X_test)
dev_prediction.tofile('./dev-0/out.tsv', sep='\n')
test_prediction.tofile('./test-A/out.tsv', sep='\n')

5445
test-A/out.tsv Normal file

File diff suppressed because it is too large Load Diff