Views
No views yet
| Property | Value |
|---|---|
| Base model | proxectonos/MrBERT-nos-gl |
| Task | Text classification (sentiment analysis) |
| Language | Galician (gl) |
| License | Apache 2.0 |
| Labels | POSITIVE, NEUTRAL, NEGATIVE |
pip install transformers torch1from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
2
3tokenizer = AutoTokenizer.from_pretrained("proxectonos/MrBERT-nos-gl-sentiment")
4model = AutoModelForSequenceClassification.from_pretrained("proxectonos/MrBERT-nos-gl-sentiment")
5sentiment_analyzer = pipeline(
6 "text-classification",
7 model=model,
8 tokenizer=tokenizer,
9)
10
11text = "A película pareceume moi interesante e emotiva."
12results = sentiment_analyzer(text, top_k=3)
13
14for i, result in enumerate(sorted(results, key=lambda x: x['score'], reverse=True)):
15 print(f"{i+1}. {result['label']:<20} {result['score']*100:.1f}%")1. POSITIVE 91.3%
2. NEUTRAL 6.2%
3. NEGATIVE 2.5%1while True:
2 text = input("Enter text to analyze sentiment: ").strip()
3 if text.lower() in ["quit", "exit", "q"]:
4 break
5 results = sentiment_analyzer(text, top_k=3)
6 for i, r in enumerate(sorted(results, key=lambda x: x['score'], reverse=True)):
7 bar = "█" * int(r['score'] * 20)
8 print(f" {i+1}. {r['label']:<20} {r['score']*100:5.1f}% {bar}")1@misc{proxectenos2026mrbert-nos-gl-sentiment,
2 author = {{Proxecto Nós}},
3 title = {{MrBERT-nos-gl-sentiment}: Sentiment Analysis for Galician},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/proxectonos/MrBERT-gl-sentiment}},
7}