Predicting next word using the language model tensorflow example

后端 未结 3 919
栀梦
栀梦 2020-12-17 17:10

The tensorflow tutorial on language model allows to compute the probability of sentences :

probabilities = tf.nn.softmax(logits)

in the co

3条回答
  •  盖世英雄少女心
    2020-12-17 18:14

    It is actually an advantage that the function returns a probability instead of the word itself. Since it is using a list of words, with the associated probabilities, you can do further processing, and increase the accuracy of your result.

    To answer your question: You can take the list of words, iterate though it , and make the program display the word with the highest probability.

提交回复
热议问题