This commit is contained in:
pietrzakkuba 2022-04-03 15:27:51 +02:00
parent a83a751185
commit bd345e8e26

4
run.py
View File

@ -63,10 +63,10 @@ model_len = len(model)
for index, words_1_3 in enumerate(model):
if index % 100000 == 0:
print(f'normalizacja: {index / model_len}')
occurences = sum(model[words_1_3].values())
occurrences = sum(model[words_1_3].values())
for word_2 in model[words_1_3]:
model[words_1_3][word_2] += alpha
model[words_1_3][word_2] /= float(occurences + alpha + len(word_2))
model[words_1_3][word_2] /= float(occurrences + alpha + len(word_2))
make_prediction('test-A')