# Can we actually get the probability of a text using recurrent neural network?

I know that recurrent neural network is used to generate text and to model the probability of $$P(x_0,x_1,x_2,x_3)=P(x_0)P(x_1|x_0)P(x_2|x_1,x_0)P(x_3|x_2,x_1,x_0)$$ where $$x_i$$ is words/text.
If RNN can model probability, Can we calculate the probability of a text?
for example: It produces low probability for text with no meaning and high probability for normal text.
What about CNN, Can we generate probability for images(for example: low probability for fake images)?

• Thank you so much for your answer. can you please provide an example? for example: If I want to calculate the probability of a text, Should I build a RNN(seq2seq?) to output the same input and then after training, I take the product of the output probabilities?? $P(x_0,x_1,x_2)=P(x_0)P(x_1|x_0)P(x_2|x_1,x_0)$ . Am I right? – floyd Sep 10 '19 at 5:06