linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Bug in client/linguist.py

Open arnfaldur opened this issue 11 years ago • 7 comments

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.

arnfaldur avatar Feb 22 '14 14:02 arnfaldur

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'

tleyden avatar Feb 22 '14 20:02 tleyden

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.

TobiasWeis avatar Feb 25 '14 20:02 TobiasWeis

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)

ObiL avatar Mar 03 '14 04:03 ObiL

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?

arnfaldur avatar Mar 13 '14 22:03 arnfaldur

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.

breznak avatar Mar 13 '14 22:03 breznak

Same here ended up using the c = result.inferences['multiStepBestPrediction'][1]

brusacco avatar Apr 29 '14 22:04 brusacco

thanks guys, should be fix by the PR above. Closing..

breznak avatar May 20 '15 21:05 breznak