From ecccea3cc416e86db673f59ecc1f523026abcd4d Mon Sep 17 00:00:00 2001 From: Jan Nowak Date: Sun, 3 Apr 2022 20:37:56 +0200 Subject: [PATCH] Back to complete only --- run.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/run.py b/run.py index 8d7dc8b..c79a24f 100644 --- a/run.py +++ b/run.py @@ -128,15 +128,10 @@ def predict(search_for_words): # left_context = trigram.split("_")[0] # left_context_search_for_word_not_complete[bigram_not_complete] = left_context - # for search_for_word in search_for_words: - # if search_for_word in left_context_search_for_word: - # left_context = left_context_search_for_word[search_for_word] - # print(f"{left_context} {' '.join(search_for_word.split('_'))} {trigrams_complete['_'.join([left_context, search_for_word])]/bigrams_complete[search_for_word]}") - # elif search_for_word in left_context_search_for_word_not_complete: - # left_context = left_context_search_for_word[search_for_word] - # print(f"{left_context} {' '.join(search_for_word.split('_'))} {trigrams_not_complete['_'.join([left_context, search_for_word])]/bigrams_not_complete[search_for_word]}") - # else: - # print(f"??? {' '.join(search_for_word.split('_'))}") + for search_for_word in search_for_words: + if search_for_word in left_context_search_for_word: + left_context = left_context_search_for_word[search_for_word] + print(f"{left_context} {' '.join(search_for_word.split('_'))} {trigrams_complete['_'.join([left_context, search_for_word])]/bigrams_complete[search_for_word]}") def load_dev(): # Ładowanie zbioru testującego