Documentation and news: happytransformer.com
New Course: Create a text generation web app. Also learn how to fine-tune GPT-Neo link
Happy Transformer is an package built on top of Hugging Face's transformer library that makes it easy to utilize state-of-the-art NLP models.
Public Methods | Basic Usage | Training |
---|---|---|
Text Generation | ✔ | ✔ |
Text Classification | ✔ | ✔ |
Word Prediction | ✔ | ✔ |
Question Answering | ✔ | ✔ |
Text-to-Text | ✔ | ✔ |
Next Sentence Prediction | ✔ | |
Token Classification | ✔ |
pip install happytransformer
from happytransformer import HappyWordPrediction
#--------------------------------------#
happy_wp = HappyWordPrediction() # default uses distilbert-base-uncased
result = happy_wp.predict_mask("I think therefore I [MASK]")
print(result) # [WordPredictionResult(token='am', score=0.10172799974679947)]
print(result[0].token) # am
- Eric Fillion Lead Maintainer
- Ted Brownlow Maintainer
Text generation with training (GPT-Neo)
Text classification (training)
Text classification (hate speech detection)
Text classification (sentiment analysis)