A Transformer-based library for Sentiment Analysis in Spanish
Project description
PySentimiento: Sentiment Analysis in Spanish
A simple Transformer-based library for Spanish.
from pysentimiento import SentimentAnalyzer
analyzer = SentimentAnalyzer()
analyzer.predict("Qué gran jugador es Messi")
# returns 'POS'
analyzer.predict("Esto es pésimo")
# returns 'NEG'
analyzer.predict("Qué es esto?")
# returns 'NEU'
analyzer.predict_probas("Qué es esta cosa?")
# returns {'NEG': 0.7448181509971619,
# 'NEU': 0.22246581315994263,
# 'POS': 0.032716117799282074}
Also, you might use pretrained models directly with transformers
library.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("finiteautomata/beto-sentiment-analysis")
model = AutoModelForSequenceClassification.from_pretrained("finiteautomata/beto-sentiment-analysis")
Trained models so far
Instructions for developers
- First, download TASS 2020 data to
data/tass2020
- Run notebooks to train models
- Upload models to Huggingface's Model Hub
TODO:
- Upload some other models
- Train in other languages
- Write brief paper with description
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pysentimiento-0.1.0rc1.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for pysentimiento-0.1.0rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6f8f10e3199f2fd6d021e6e765ef3e5ebea9a06d93524371696c2c892e656e3 |
|
MD5 | 6972c7df0ec4c5a298198c6b43eee1ad |
|
BLAKE2b-256 | 6735337315a7208973cd877d3d64c8c4fd82b446d6a62b8d1f7587137ee700ea |