Text Classification
Transformers
Safetensors
Spanish
bert
emotion-recognition
spanish
text-embeddings-inference
Instructions to use alexander1010/expon-emotions with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alexander1010/expon-emotions with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="alexander1010/expon-emotions")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("alexander1010/expon-emotions") model = AutoModelForSequenceClassification.from_pretrained("alexander1010/expon-emotions", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| from src.infer import predict | |
| app = FastAPI(title="Expon Emotions Service") | |
| class InputText(BaseModel): | |
| transcript: str | |
| def analyze_emotions(item: InputText): | |
| label, prob, dist = predict(item.transcript) | |
| return { | |
| "dominant_emotion": label, | |
| "probability": prob, | |
| "distribution": dist | |
| } | |