Skip to main content

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

  1. First, download TASS 2020 data to data/tass2020
  2. Run notebooks to train models
  3. Upload models to Huggingface's Model Hub

TODO:

  • Upload some other models
  • Train in other languages
  • Write brief paper with description

Project details


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysentimiento-0.1.0rc1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file pysentimiento-0.1.0rc1.tar.gz.

File metadata

  • Download URL: pysentimiento-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for pysentimiento-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 38abd6a7acab0aac5098efdd188087414438e1d77851f243ae9116221ed7b6a4
MD5 d715124203c49e4c0542412c1eb8d2fd
BLAKE2b-256 1cb4e3a9cd00942aec446087fffdff0fb26256eaf992eb47fe45025d2741ea02

See more details on using hashes here.

File details

Details for the file pysentimiento-0.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: pysentimiento-0.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for pysentimiento-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6f8f10e3199f2fd6d021e6e765ef3e5ebea9a06d93524371696c2c892e656e3
MD5 6972c7df0ec4c5a298198c6b43eee1ad
BLAKE2b-256 6735337315a7208973cd877d3d64c8c4fd82b446d6a62b8d1f7587137ee700ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page