This commit is contained in:
adnovac 2022-04-12 10:43:14 +02:00
parent b6dd9396b3
commit 9351a7163c
3 changed files with 17936 additions and 17936 deletions

File diff suppressed because it is too large Load Diff

6
run.py
View File

@ -11,8 +11,8 @@ class Model:
def __init__(self):
self.model = defaultdict(lambda: defaultdict(lambda: 0))
self.model_bi = defaultdict(lambda: defaultdict(lambda: 0))
train_in = pd.read_csv("train/in.tsv.xz", sep='\t', header=None, encoding="UTF-8", on_bad_lines="skip", quoting=csv.QUOTE_NONE, nrows=20500)[[6, 7]]
train_expected = pd.read_csv("train/expected.tsv", sep='\t', header=None, encoding="UTF-8", on_bad_lines="skip", quoting=csv.QUOTE_NONE, nrows=20500)
train_in = pd.read_csv("train/in.tsv.xz", sep='\t', header=None, encoding="UTF-8", on_bad_lines="skip", quoting=csv.QUOTE_NONE, nrows=30000)[[6, 7]]
train_expected = pd.read_csv("train/expected.tsv", sep='\t', header=None, encoding="UTF-8", on_bad_lines="skip", quoting=csv.QUOTE_NONE, nrows=30000)
data = pd.concat([train_in, train_expected], axis=1)
self.data = data[6] + data[0] + data[7]
self.data = self.data.apply(self.clean)
@ -22,7 +22,7 @@ class Model:
return text
def train(self):
alpha = 0.7
alpha = 0.4
vocab = set()
for text in model.data:
words = word_tokenize(text)

File diff suppressed because it is too large Load Diff