This commit is contained in:
jakub 2021-05-08 12:51:14 +02:00
parent 756ef4277a
commit 5e66be7f46
7 changed files with 315603 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

BIN
geval Executable file

Binary file not shown.

24
main.py Normal file
View File

@ -0,0 +1,24 @@
from sklearn import preprocessing
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import make_pipeline
import numpy as np
eng = preprocessing.LabelEncoder()
with open("train/in.tsv") as myFile:
tmp = myFile.readlines()
with open("train/expected.tsv") as finFile:
fin = finFile.readlines()
fin = eng.fit_transform(fin)
with open("test-A/in.tsv") as tFile:
fic = tFile.readlines()
gnb = make_pipeline(TfidfVectorizer(),MultinomialNB())
model = gnb.fit(tmp, fin)
fin_pred = model.predict(fic)
fin_pred = np.array(fin_pred)
np.set_printoptions(threshold = np.inf)
eFile = np.array2string(fin_pred.flatten(), precision = 2, separator = '\n',suppress_small = True)
myFile = open("test-A/out.tsv", "a")
myFile.write(eFile)

5152
test-A/in.tsv Normal file

File diff suppressed because one or more lines are too long

10304
test-A/out.tsv Normal file

File diff suppressed because it is too large Load Diff

289579
train/in.tsv Normal file

File diff suppressed because one or more lines are too long