bert base multilingual uncased sentiment

Providernlptown
Categorytext-classification
Licensemit
Downloads786.6K
Stars0

Overview

The bert-base-multilingual-uncased-sentiment model is a specialized text-classification tool designed for cross-lingual sentiment analysis. Unlike standard BERT models that require extensive fine-tuning for specific languages, this version is pre-trained to map sentiment across multiple languages into a consistent rating scale. For developers, this means a single deployment can handle user feedback or reviews in various languages without needing a separate pipeline for each locale. It is particularly effective for building automated customer satisfaction trackers or global social listening tools where identifying the polarity of a statement is more critical than deep semantic parsing. Integration is straightforward via standard Hugging Face transformers, making it a plug-and-play option for adding multilingual sentiment detection to existing applications.

Highlights

  • Supports sentiment analysis across multiple languages
  • Standardized rating output for consistent evaluation
  • Easy integration via Hugging Face transformers
  • MIT licensed for flexible commercial deployment
  • Eliminates need for language-specific sentiment pipelines

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("nlptown/bert-base-multilingual-uncased-sentiment")
tokenizer = AutoTokenizer.from_pretrained("nlptown/bert-base-multilingual-uncased-sentiment")

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 nlptown/bert-base-multilingual-uncased-sentiment

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 nlptown/bert-base-multilingual-uncased-sentiment 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('nlptown/bert-base-multilingual-uncased-sentiment')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/nlptown/bert-base-multilingual-uncased-sentiment

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/nlptown/bert-base-multilingual-uncased-sentiment

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('nlptown/bert-base-multilingual-uncased-sentiment')
tokenizer = AutoTokenizer.from_pretrained('nlptown/bert-base-multilingual-uncased-sentiment')

Full Documentation

来源: HuggingFace

---
language:

  • en

  • nl

  • de

  • fr

  • it

  • es

license: mit
---

bert-base-multilingual-uncased-sentiment

Visit the NLP Town website for an updated version of this model, with a 40% error reduction on product reviews.

This is a bert-base-multilingual-uncased model finetuned for sentiment analysis on product reviews in six languages: English, Dutch, German, French, Spanish, and Italian. It predicts the sentiment of the review as a number of stars (between 1 and 5).

This model is intended for direct use as a sentiment analysis model for product reviews in any of the six languages above or for further finetuning on related sentiment analysis tasks.

Training data

Here is the number of product reviews we used for finetuning the model:

| Language | Number of reviews |
| -------- | ----------------- |
| English | 150k |
| Dutch | 80k |
| German | 137k |
| French | 140k |
| Italian | 72k |
| Spanish | 50k |

Accuracy

The fine-tuned model obtained the following accuracy on 5,000 held-out product reviews in each of the languages:

  • Accuracy (exact) is the exact match for the number of stars.
  • Accuracy (off-by-1) is the percentage of reviews where the number of stars the model predicts differs by a maximum of 1 from the number given by the human reviewer.

| Language | Accuracy (exact) | Accuracy (off-by-1) |
| -------- | ---------------------- | ------------------- |
| English | 67% | 95%
| Dutch | 57% | 93%
| German | 61% | 94%
| French | 59% | 94%
| Italian | 59% | 95%
| Spanish | 58% | 95%

Contact

In addition to this model, NLP Town offers custom models for many languages and NLP tasks.

If you found this model useful, you can buy us a coffee.

Feel free to contact us for questions, feedback and/or requests for similar models.

Join our Telegram