distilbert-base-multilingual-cased-sentiments-student

The distilbert-base-multilingual-cased-sentiments-student model is a lightweight, multilingual sentiment‑analysis classifier distilled from a powerful zero‑shot teacher (MoritzLaurer/mDeBERTa‑v3‑base‑mnli‑xnli). It accepts raw text in twelve languages (English, Arabic, German, Spanish, French, Japanese, Chinese, Indonesian, Hindi, Italian, Malay, Portuguese) and returns a three‑way sentiment distribution –

lxyuan 671K downloads apache-2.0 Text Classification
Frameworkstransformerspytorchonnxsafetensors
Languagesenardeesfrja
Datasetstyqiangz/multilingual-sentiments
Tagsdistilberttext-classificationsentiment-analysiszero-shot-distillationdistillationzero-shot-classificationdebarta-v3doi:10.57967/hf/1422
Downloads
671K
License
apache-2.0
Pipeline
Text Classification
Author
lxyuan

Run distilbert-base-multilingual-cased-sentiments-student locally on a Q4KM hard drive

Accelerate your multilingual sentiment pipelines with Q4KM hard drives pre‑loaded with this model . Get instant, plug‑and‑play performance on your on‑premise servers – no download, no setup time. Buy...

Shop Q4KM Drives

Technical Overview

The distilbert-base-multilingual-cased-sentiments-student model is a lightweight, multilingual sentiment‑analysis classifier distilled from a powerful zero‑shot teacher (MoritzLaurer/mDeBERTa‑v3‑base‑mnli‑xnli). It accepts raw text in twelve languages (English, Arabic, German, Spanish, French, Japanese, Chinese, Indonesian, Hindi, Italian, Malay, Portuguese) and returns a three‑way sentiment distribution – positive, neutral, and negative. The model is built on the distilbert‑base‑multilingual‑cased backbone, which is a 6‑layer, 768‑dimensional transformer that has been “distilled” to retain most of the teacher’s knowledge while being far smaller and faster.

Key features and capabilities

  • Multilingual support for 12 languages without language‑specific fine‑tuning.
  • Zero‑shot distillation: the student learns from a teacher that uses a hypothesis template “The sentiment of this text is {}.”
  • Fast inference – < 30 ms per sentence on a single RTX 3080 (FP16).
  • Compatible with Hugging Face pipeline for text‑classification, ONNX, and Safetensors.
  • Return‑all‑scores mode enables downstream ranking or ensemble strategies.

Architecture highlights

  • Base architecture: DistilBERT (6 transformer encoder layers, 12 attention heads).
  • Pre‑trained on multilingual cased corpora, then fine‑tuned via zero‑shot distillation on the tyqiangz/multilingual‑sentiments dataset.
  • Training objective: Kullback‑Leibler divergence between teacher and student soft‑max outputs.
  • Uses the hypothesis template to turn sentiment classification into a natural‑language inference (NLI) problem.

Intended use cases

  • Real‑time sentiment monitoring for social‑media streams in multiple languages.
  • Customer‑feedback analysis for global e‑commerce platforms.
  • Multilingual chat‑bot emotion detection.
  • Lightweight edge deployment where GPU memory is limited.

Benchmark Performance

The most relevant benchmarks for this model are agreement with the teacher on the multilingual sentiment test set and standard sentiment‑analysis metrics (accuracy, F1) across the twelve supported languages. The training log reports an 88.29 % agreement between student and teacher predictions on 146 721 evaluation examples, indicating that the distilled model captures the majority of the teacher’s NLI‑based sentiment reasoning. Although the README does not list per‑language accuracy, the high agreement score typically translates to > 85 % accuracy on well‑balanced sentiment corpora.

Compared to the full‑size DeBERTa‑v3‑base teacher, the student model is ≈ 40 % smaller (≈ 66 M parameters vs. 134 M) and runs 2–3× faster on the same hardware, while losing only a few points of performance. This trade‑off makes it competitive with other multilingual distilled models such as xlm‑roberta‑base for sentiment tasks, especially when inference latency and memory footprint are critical.

Hardware Requirements

  • VRAM for inference: 2 GB (FP16) is sufficient for a single‑sentence batch; 4 GB is recommended for batch sizes ≥ 32.
  • Recommended GPU: NVIDIA RTX 3060/3070/3080 or any GPU with at least 8 GB of VRAM for optimal throughput.
  • CPU requirements: Modern x86‑64 CPUs (Intel i5‑10600K or AMD Ryzen 5 5600X) can run the model at ~100 ms per sentence in FP32; using torch.cuda.amp (FP16) reduces this to < 30 ms.
  • Storage: The model files (config, tokenizer, weights) occupy ~ 300 MB when stored in Safetensors format.
  • Performance characteristics: In batch mode (size = 64) on an RTX 3080, throughput reaches ~ 200 sentences / second (FP16).

Use Cases

The model excels in any scenario where rapid, multilingual sentiment detection is required. Typical applications include:

  • Social‑media listening: Monitor brand perception across English, Arabic, Japanese, etc., in real time.
  • Customer‑service analytics: Automatically tag support tickets with sentiment to prioritize negative experiences.
  • Content moderation: Flag potentially harmful or toxic content based on negative sentiment cues.
  • Market research: Aggregate sentiment scores from product reviews in multiple languages for global insights.
  • Edge AI devices: Deploy on smartphones or IoT gateways where memory and compute are limited.

Training Details

The student model was trained using the zero‑shot‑distillation script from Hugging Face. The process involved:

  • Dataset: tyqiangz/multilingual‑sentiments, a 12‑language corpus with sentiment labels (positive, neutral, negative).
  • Teacher: MoritzLaurer/mDeBERTa-v3-base-mnli-xnli with the hypothesis template “The sentiment of this text is {}.”
  • Student: distilbert-base-multilingual-cased (6 layers, 66 M parameters).
  • Hyper‑parameters: 1 epoch, batch size 16 (student), 32 (teacher), fp16 mixed precision, max sequence length 512.
  • Compute: Trained on a single NVIDIA V100 (16 GB) for ~ 33 minutes (≈ 2000 seconds) consuming ~ 73 samples / second.
  • Fine‑tuning: The model can be further fine‑tuned on domain‑specific sentiment data using the standard Trainer API; the tokenizer and model weights are already hosted on Hugging Face for easy reuse.

Licensing Information

The model card lists the license as Apache‑2.0 (the same license used for the underlying DistilBERT checkpoint). Apache‑2.0 is a permissive open‑source license that grants users the right to use, modify, distribute, and sell the software, provided that a copy of the license and a notice of any modifications are included. Commercial use is therefore allowed without royalty payments.

Key obligations include:

  • Preserve the original copyright notice and license text in any redistribution.
  • If you modify the model or its weights, you must clearly indicate that changes were made.
  • No trademark usage of the original authors (lxyuan, MoritzLaurer) without permission.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives