linguist
linguist copied to clipboard
Bug in client/linguist.py
in line 122: result.inferences['prediction'][0] 'prediction' is not in the result dict and neither is index [0] I haven't been able to find the source of the problem but this makes this linguist unusable.
Ditto - I'm running on commit https://github.com/numenta/nupic/commit/690297c2d47a1db36312604e7436da0487f44b79
When I ran it and entered "once upon a time", I got:
Welcome young adventurer, let me tell you a story!
Enter story start (QUIT to go to work): once upon a time
o n c e u p o n a t i m e e
Traceback (most recent call last):
File "client/linguist.py", line 156, in <module>
tellStory(model, STORY_START, NUM_SENTENCES)
File "client/linguist.py", line 122, in tellStory
c=result.inferences['prediction'][0] # bug in model randomization of same-probability states
KeyError: 'prediction'
Same problem here. A fix would be really appreciated ! Tried to exchange c=result.inferences['prediction'][0] to c=result.inferences['multiStepPredictions'].values()[0].keys()[0], but that does not help either.
I think I used c = result.inferences['multiStepBestPrediction'][1] and that ran without the KeyError. But I don't know that this is the intent of the code because it's giving me the same output again and again (stories that are the same sentence repeated ten times, for example)
I ended up doing the same thing: c = result.inferences['multiStepBestPrediction'][1] I got the same one phrase stories as you @ObiL Can anyone using the correct commit shed light on how the results are supposed to look?
I think proper way would be either look at the code documentation to find out, or turn to nupic-discuss for help. I can have a look at it at the weekend..hopefully.
Same here ended up using the c = result.inferences['multiStepBestPrediction'][1]
thanks guys, should be fix by the PR above. Closing..