if in the UNQ_C9 convert tuple from a string I recive something like this :
[like] → [l, i, k, e]
i try to fix by the code
if type(previous_n_gram) is list ==> previous_n_grams = tuple(previous_n_gram)
else
==>previous_n_grams = tuple([previous_n_gram])
But the Estimate probabilities for all words i not recive expect output
this I recive.
- What wrong with my code
- Is previous_n_gram assign tuple(previous_n_gram) is wrong or correct
{‘a’: 0.1111111111111111,
‘is’: 0.1111111111111111,
‘like’: 0.1111111111111111,
‘this’: 0.1111111111111111,
‘cat’: 0.1111111111111111,
‘dog’: 0.1111111111111111,
‘i’: 0.1111111111111111,
‘’: 0.1111111111111111,
‘’: 0.1111111111111111}