Skip to content
Snippets Groups Projects
Commit 28defd0e authored by jmzk96's avatar jmzk96
Browse files

added correction for x

parent 96afc46e
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,7 @@ class GrammarCheckerGoogle:
probs = [self.float_min]
chained_probs = math.prod(probs)
diff_list = [(j-i) for i, j in zip(probs[:-1], probs[1:])]
logged_chained_prob = -np.log10((chained_probs)**(1/len(n_grams))) if x != 0 else (chained_probs)**(1/len(n_grams))
logged_chained_prob = -np.log10((chained_probs)**(1/len(n_grams))) if (chained_probs)**(1/len(n_grams)) != 0 else (chained_probs)**(1/len(n_grams))
if logged_chained_prob <= self.threshold:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment