Instructions to use sabersol/bert-base-uncased-emotion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sabersol/bert-base-uncased-emotion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="sabersol/bert-base-uncased-emotion")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("sabersol/bert-base-uncased-emotion") model = AutoModelForSequenceClassification.from_pretrained("sabersol/bert-base-uncased-emotion") - Notebooks
- Google Colab
- Kaggle
CITDA:
Fine-tuned bert-base-uncased on the emotions dataset
Demo Notebook: https://colab.research.google.com/drive/10ZCFvlf2UV3FjU4ymf4OoipQvqHbIItG?usp=sharing
Packages
- Install
torch - Also,
pip install transformers datasets scikit-learn wandb seaborn python-dotenv
Train
- Rename
.env.exampleto.envand set an API key from wandb - You can adjust model parameters in the
explainableai.pyfile. - The model (
pytorch_model.bin) is a based on thebert-base-uncasedand already trained on theemotionsdataset. To re-produce the training runfinetune-emotions.py. You can change the base model, or the dataset by changing that file's code.
Example
Run example.py
Train
The model is already trained on bert-base-uncased with the emotions dataset. However, you can change parameters and re-fine-tune the model by running finetune-emotions.py.
- Downloads last month
- 9