This commit is contained in:
jakub 2021-05-13 19:09:09 +02:00
parent 647c099815
commit 3542d203c6
7 changed files with 260744 additions and 0 deletions

19
Main.py Normal file
View File

@ -0,0 +1,19 @@
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LinearRegression
from stop_words import get_stop_words
import pandas as pd
meh = TfidfVectorizer(stop_words = get_stop_words('polish'))
linReg = LinearRegression()
colnames = ['start_date', 'end_date', 'title', 'sort_title', 'data']
t = pd.read_csv('test-A/in.tsv', sep = "\t", names = colnames)
datFin = pd.read_csv('train/train.tsv', sep = "\t", names = colnames)
date = (datFin['start_date'] + datFin['end_date']) / 2
trn = meh.fit_transform(datFin['data'])
linReg.fit(trn, date)
r = meh.transform(t['data'])
x = linReg.predict(r)
with open('test-A/out.tsv', 'w') as file:
for each in x:
file.write("%f\n" % each)

20000
dev-0/out.tsv Normal file

File diff suppressed because it is too large Load Diff

11563
dev-1/out.tsv Normal file

File diff suppressed because it is too large Load Diff

BIN
geval Executable file

Binary file not shown.

14220
test-A/out.tsv Normal file

File diff suppressed because it is too large Load Diff

107471
train/meta.tsv Normal file

File diff suppressed because it is too large Load Diff

107471
train/train.tsv Normal file

File diff suppressed because one or more lines are too long