Compare commits

..

4 Commits

Author SHA1 Message Date
Jan Przybylski
bf6bbf28ff update 2021-04-20 22:51:32 +02:00
Jan Przybylski
e92ad61864 update 2021-04-20 19:12:08 +02:00
Jan Przybylski
5d7436ffe9 update 2021-04-20 18:58:35 +02:00
Jan Przybylski
8967a904f8 update 2021-04-20 18:55:51 +02:00
5 changed files with 20872 additions and 0 deletions

5272
dev-0/in.tsv Normal file

File diff suppressed because one or more lines are too long

5272
dev-0/out.tsv Normal file

File diff suppressed because it is too large Load Diff

24
program.py Normal file
View File

@ -0,0 +1,24 @@
import numpy as np
from sklearn import preprocessing
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import make_pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
le=preprocessing.LabelEncoder()
with open("train/in.tsv") as f:
X = f.readlines()
with open("train/expected.tsv") as ff:
Y = ff.readlines()
Y= le.fit_transform(Y)
with open("test-A/in.tsv") as d:
r = d.readlines()
gnb = make_pipeline(TfidfVectorizer(),MultinomialNB())
model=gnb.fit(X, Y)
y_pred=model.predict(r)
y_pred=np.array(y_pred)
np.set_printoptions(threshold=np.inf)
t=np.array2string(y_pred.flatten(), precision=2, separator='\n',suppress_small=True)
f = open("test-A/out.tsv", "a")
f.write(t)

5152
test-A/in.tsv Normal file

File diff suppressed because one or more lines are too long

5152
test-A/out.tsv Normal file

File diff suppressed because it is too large Load Diff