Skip to content

rdgozum/next-word-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Next Word Prediction

Generative Pretrained Transformer 2 (GPT-2) for Language Modeling using the PyTorch-Transformers library.

Installation

Requires python>=3.5, pytorch>=1.6.0, pytorch-transformers>=1.2.0

pip install next-word-prediction

How to use

>>> from next_word_prediction import GPT2
>>> gpt2 = GPT2()
>>> text = "The course starts next"
>>> gpt2.predict_next(text, 5)
The course starts next ['week', 'to', 'month', 'year', 'Monday']

Demo via Streamlit

streamlit run app/run.py

About

Generative Pretrained Transformer 2 (GPT-2) for Language Modeling using the PyTorch-Transformers library.

Topics

Resources

License

Stars

18 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors