470628
This commit is contained in:
parent
a83a751185
commit
bd345e8e26
4
run.py
4
run.py
@ -63,10 +63,10 @@ model_len = len(model)
|
|||||||
for index, words_1_3 in enumerate(model):
|
for index, words_1_3 in enumerate(model):
|
||||||
if index % 100000 == 0:
|
if index % 100000 == 0:
|
||||||
print(f'normalizacja: {index / model_len}')
|
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]:
|
for word_2 in model[words_1_3]:
|
||||||
model[words_1_3][word_2] += alpha
|
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')
|
make_prediction('test-A')
|
||||||
|
Loading…
Reference in New Issue
Block a user