bertweet base sentiment analysis

Providerfiniteautomata
Categorytext-classification
LicenseApache-2.0
Downloads1.5M
Stars0

Overview

Bertweet-base-sentiment is a specialized transformer model fine-tuned specifically for sentiment classification within the noisy environment of social media. Unlike general-purpose BERT models, this architecture is pre-trained on a massive corpus of English tweets, making it natively proficient at handling hashtags, emojis, and the idiosyncratic slang common in short-form text. For developers, this means higher accuracy on real-world user-generated content without the need for extensive custom preprocessing. It is an ideal drop-in solution for building brand monitoring tools, customer feedback loops, or real-time social listening dashboards where detecting nuance in informal language is critical.

Highlights

  • Optimized for social media slang, emojis, and hashtags
  • High-accuracy sentiment classification for short-form text
  • Apache-2.0 license for flexible commercial integration
  • Reduced preprocessing overhead for noisy user-generated content

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("finiteautomata/bertweet-base-sentiment-analysis")
tokenizer = AutoTokenizer.from_pretrained("finiteautomata/bertweet-base-sentiment-analysis")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download finiteautomata/bertweet-base-sentiment-analysis

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download finiteautomata/bertweet-base-sentiment-analysis config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('finiteautomata/bertweet-base-sentiment-analysis')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/finiteautomata/bertweet-base-sentiment-analysis

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/finiteautomata/bertweet-base-sentiment-analysis

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('finiteautomata/bertweet-base-sentiment-analysis')
tokenizer = AutoTokenizer.from_pretrained('finiteautomata/bertweet-base-sentiment-analysis')

Full Documentation

来源: HuggingFace

---
language:
- en

tags:
- sentiment-analysis

---

Sentiment Analysis in English


bertweet-sentiment-analysis

Repository: https://github.com/finiteautomata/pysentimiento/

Model trained with SemEval 2017 corpus (around ~40k tweets). Base model is BERTweet, a RoBERTa model trained on English tweets.

Uses POS, NEG, NEU labels.

License

pysentimiento is an open-source library for non-commercial use and scientific research purposes only. Please be aware that models are trained with third-party datasets and are subject to their respective licenses.

1. TASS Dataset license
2. [SEMEval 2017 Dataset license]()

Citation

If you use pysentimiento in your work, please cite this paper

code
@misc{perez2021pysentimiento,
      title={pysentimiento: A Python Toolkit for Sentiment Analysis and SocialNLP tasks},
      author={Juan Manuel Pérez and Juan Carlos Giudici and Franco Luque},
      year={2021},
      eprint={2106.09462},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
Enjoy! 🤗
Join our Telegram