MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / get_words

Function get_words

nlp_class2/markov.py:93–94  ·  view source on GitHub ↗
(sentence)

Source from the content-addressed store, hash-verified

91 # a function to map word indexes back to real words
92 idx2word = dict((v, k) for k, v in iteritems(word2idx))
93 def get_words(sentence):
94 return ' '.join(idx2word[i] for i in sentence)
95
96
97 # when we sample a fake sentence, we want to ensure not to sample

Callers 1

markov.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected