# Sentence Prediction

**URL:** <https://discuss.huggingface.co/t/sentence-prediction/15312>\
**Category:** Beginners\
**Created:** [March 3, 2022, 12:59pm UTC](https://discuss.huggingface.co/t/sentence-prediction/15312 "2022-03-03T12:59:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oskrmiguel](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/oskrmiguel/32/27804_2.png) [@oskrmiguel](https://discuss.huggingface.co/u/oskrmiguel)\
**Post date:** [March 3, 2022, 12:59pm UTC](https://discuss.huggingface.co/t/sentence-prediction/15312/1 "2022-03-03T12:59:16Z")

</div>

Hello everybody, a question, how can I do the following: given a sentence A, how can I know what is the probability of generating another sentence B, with language models? For example, given the sentence A: the cat is hungry, what is the probability that it generates the sentence B: The cat has already eaten.

---

<div class="post-metadata">

**Author:** ![anwarika](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@anwarika](https://discuss.huggingface.co/u/anwarika)\
**Post date:** [March 3, 2022, 2:12pm UTC](https://discuss.huggingface.co/t/sentence-prediction/15312/2 "2022-03-03T14:12:01Z")

</div>

Hi @oskrmiguel it depends on the Model. I did find this forum question that may help you find some insight into your question. [Generation Probabilities: How to compute probabilities of output scores for GPT2 - #22 by Aktsvigun](https://discuss.huggingface.co/t/generation-probabilities-how-to-compute-probabilities-of-output-scores-for-gpt2/3175/22)

---

<div class="post-metadata">

**Author:** ![oskrmiguel](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/oskrmiguel/32/27804_2.png) [@oskrmiguel](https://discuss.huggingface.co/u/oskrmiguel)\
**Post date:** [March 3, 2022, 2:29pm UTC](https://discuss.huggingface.co/t/sentence-prediction/15312/3 "2022-03-03T14:29:15Z")

</div>

Hello @anwarika the model I am using is Bart

---

<div class="post-metadata">

**Author:** ![anwarika](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@anwarika](https://discuss.huggingface.co/u/anwarika)\
**Post date:** [March 3, 2022, 2:39pm UTC](https://discuss.huggingface.co/t/sentence-prediction/15312/4 "2022-03-03T14:39:13Z")

</div>

I don’t know if BART stores that, you may calculate each tokens probability.
