Skip to content

Commit

Permalink
disable learn for story-tell run
Browse files Browse the repository at this point in the history
  • Loading branch information
breznak committed Nov 16, 2013
1 parent 0ec5509 commit dc0549d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions client/linguist.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def runLinguist(datapath):

modelInput = {'letter': c}
result = model.run(modelInput)
if should_print:
print "[%i]\t %s ==> %s\t(%s)" % (i, clean(modelInput['letter']), prediction(result.inferences), confidences(result.inferences))
#if should_print:
#print "[%i]\t %s ==> %s\t(%s)" % (i, clean(modelInput['letter']), prediction(result.inferences), confidences(result.inferences))
if c in TERMINATORS:
model.resetSequenceStates()
print "reset"
Expand All @@ -95,19 +95,21 @@ def runLinguist(datapath):
return model

def tellStory(model, startSent, lenght):

model.disableLearning()
for s in startSent:
print(s)
print(s),
modelInput = {'letter': s}
result = model.run(modelInput)

numSent = 0
c = s
while numSent <= lenght:
print c
print(c),
modelInput = {'letter': c}
result = model.run(modelInput)
print(result)
print(result.inferences)
c=result.inferences['prediction'][0]

if c in TERMINATORS:
numSent += 1

Expand Down

0 comments on commit dc0549d

Please sign in to comment.