Skip to main content

Happy Transformer is an API built on top of Hugging Face's Transformer library that makes it easy to utilize state-of-the-art NLP models.

Project description

License Downloads Website PyPI

Happy Transformer

Documentation and news:

New Course: Create a text generation web app. Also learn how to fine-tune GPT-Neo link

Join our Discord server: Support Server


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
Next Sentence Prediction
Token Classification

Quick Start

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



Text generation with training (GPT-Neo)

Text classification (training)

Text classification (hate speech detection)

Text classification (sentiment analysis)

Word prediction with training (DistilBERT, RoBERTa)

Top T5 Models

Grammar Correction

Fine-tune a Grammar Correction Model

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

happytransformer-2.4.1.tar.gz (24.3 kB view hashes)

Uploaded source

Built Distribution

happytransformer-2.4.1-py3-none-any.whl (45.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page