Generative Pretrained Transformer 2 (GPT-2) for Language Modeling using the PyTorch-Transformers library.
Project description
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)
The course starts next ['week', 'to', 'month', 'year', 'Monday']
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for next_word_prediction-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a949337a816fffa6a71f91031f32aa0ad3d503ddfbcf59cfd4133a994c1ce1ec |
|
MD5 | f51004ca12d3602276810511f8cf7587 |
|
BLAKE2b-256 | effe910889cd8986a6301f387ae01b7f0df0c3b9198b61fb6c0fdfae9e9519d1 |
Close
Hashes for next_word_prediction-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81b83327335457ed2a44b57ec2a3c11313bd10264a4cc54483b2e8eadb90db6e |
|
MD5 | 1cbcccac5e81fbcea16cb2fb64689ead |
|
BLAKE2b-256 | 187dfbcf86092d4fa5aa039f0e9ba1470977eef6ee06fc0127cb0fc6bede27e2 |