CoolFace
Modelpublic

jakubmach/cs-sentiment-small-e-czech-v2

sourceHugging Facecc-by-4.0updated 5mo agoView on Hugging Face
0likes18downloads
Model Card

Czech Sentiment Classifier — Small-E-Czech (ELECTRA)

A 3-class sentiment classifier for Czech movie reviews, fine-tuned from Seznam/small-e-czech (13.5M params, Czech ELECTRA).

Quick Start

python
from transformers import pipeline

classifier = pipeline("text-classification", model="jakubmach/cs-sentiment-small-e-czech-v2")
result = classifier("Tento film byl naprosto úžasný, skvělí herci a výborný příběh!")
print(result)  # [{'label': 'positive', 'score': 0.87}]

Training Details

ParameterValue
Base modelSeznam/small-e-czech (13.5M params)
Datasetfewshot-goes-multilingual/cs_csfd-movie-reviews
Training samples2,000 (from 25K total)
Epochs5
Learning rate1e-4
Batch size16
Max sequence length256 tokens
SchedulerCosine with 50 warmup steps
Weight decay0.01
HardwareCPU (2 vCPU, 16GB RAM)
Training time~2 hours

Label Mapping

Ratings from CSFD (0-5 stars) mapped to sentiment:

  • negative: ratings 0, 1, 2
  • neutral: rating 3
  • positive: ratings 4, 5

Results

Test Set Performance (2,500 samples)

MethodAccuracyF1 (macro)F1 (weighted)
Random baseline33.3%0.3150.349
Majority class (negative)49.6%0.2210.329
Keyword heuristic33.3%0.3360.344
Exp 1 (lr=5e-5, 3ep, 1.5K samples)60.8%0.4210.542
Exp 2 (this model) (lr=1e-4, 5ep, 2K samples)67.7%0.4880.619

Per-Class Breakdown

ClassPrecisionRecallF1Support
positive0.5860.7990.676844
negative0.7550.8210.7871,241
neutral0.0000.0000.000415

Confusion Matrix

Pred: positivePred: negativePred: neutral
Gold: positive6741700
Gold: negative2221,0190
Gold: neutral2541610

Key Observations

  1. 1.Strong binary sentiment detection: The model reliably distinguishes positive from negative reviews (positive F1=0.68, negative F1=0.79).
  2. 2.Neutral class not learned: With only ~320 neutral examples in training and the class being inherently ambiguous (3/5 rating), the model never predicts "neutral." This is the main area for improvement.
  3. 3.Data efficiency: Even with just 2,000 training samples (8% of the full dataset), the model achieves 67.7% accuracy — significantly above all baselines.
  4. 4.Improvement path: Training on the full 25K dataset with GPU, or using a larger encoder (e.g., ufal/robeczech-base at 125M params), would likely push accuracy well above 75%.

Limitations

  • Does not predict the "neutral" class (3-star reviews are classified as positive or negative)
  • Trained on only 2,000 of 25,000 available samples due to CPU training constraints
  • Reviews longer than 256 tokens are truncated
  • Domain-specific to movie reviews; may not generalize to other Czech text domains

License

CC-BY-4.0 (inherited from base model Seznam/small-e-czech)