bertweet base sentiment analysis
Overview
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 Hugging Face transformers
pip install transformers torch
# 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:
pip install -U huggingface_hub
CLI Download
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)
huggingface-cli download finiteautomata/bertweet-base-sentiment-analysis config.json --local-dir ./dir
See the official docs for more CLI options
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 lfs install
git clone https://huggingface.co/finiteautomata/bertweet-base-sentiment-analysis
To skip LFS large-file downloads, use:
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
pip install -U transformers torch
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
---
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
@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}
}