Text Classification
Transformers
Safetensors
English
Russian
xlm-roberta
emotion-classification
multi-label-classification
goemotions
english
russian
affective-computing
text-embeddings-inference
Instructions to use proxy3d/multi-motions-28 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use proxy3d/multi-motions-28 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="proxy3d/multi-motions-28")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("proxy3d/multi-motions-28") model = AutoModelForSequenceClassification.from_pretrained("proxy3d/multi-motions-28", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download predict.py from proxy3d/multi-motions-28: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/proxy3d/multi-motions-28/resolve/main/predict.py
- Command line
-
hf download hf://proxy3d/multi-motions-28/predict.py
-
curl -L -o predict.py https://huggingface.co/proxy3d/multi-motions-28/resolve/main/predict.py
1.11 kB
| #!/usr/bin/env python3 | |
| # Author: Ilya Zelenskiy (proxy3d) | |
| # Telegram channel: https://t.me/greenruff | |
| # Related project: https://github.com/iproxy3d/communication-styles-llm | |
| from __future__ import annotations | |
| import argparse | |
| import json | |
| from goemotions_en_ru import EmotionClassifier | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description="EN/RU 28-label emotion classification") | |
| parser.add_argument("text", help="English or Russian text") | |
| parser.add_argument("--model", required=True, help="Local model directory or Hugging Face model ID") | |
| parser.add_argument("--device", default="auto", choices=["auto", "cpu", "cuda", "mps"]) | |
| parser.add_argument("--top-k", type=int, default=5) | |
| parser.add_argument("--thresholds", default=None, help="Optional thresholds.json") | |
| args = parser.parse_args() | |
| classifier = EmotionClassifier( | |
| args.model, | |
| device=args.device, | |
| thresholds_path=args.thresholds, | |
| ) | |
| print(json.dumps(classifier.predict(args.text, top_k=args.top_k), ensure_ascii=False, indent=2)) | |
| if __name__ == "__main__": | |
| main() | |