Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to get probability of next word? #1

Open
orenschonlab opened this issue Feb 14, 2021 · 3 comments
Open

Is there a way to get probability of next word? #1

orenschonlab opened this issue Feb 14, 2021 · 3 comments

Comments

@orenschonlab
Copy link

orenschonlab commented Feb 14, 2021

@rdgozum Is there a way to get probability of specidic next word?
For example,

>>> from next_word_prediction import GPT2
>>> gpt2 = GPT2()
>>> text = "The course starts next"
>>> gpt2.get_next_prob(text, 'semester')
0.024

What will be the best way to implement such function?

@sktguha
Copy link

sktguha commented Apr 26, 2021

If not does it maybe rank by list of most probable first in the result ?

@rdgozum
Copy link
Owner

rdgozum commented May 18, 2021

@sktguha The function actually returns k words ranked from highest probability.

@sktguha
Copy link

sktguha commented May 20, 2021

ohh that's nice , thanks. actually one issue I find is it doesn't predict word completion
only full next words are returned. any package you might know that does that ??

Thanks in Advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants