Downloads · 30 days
0
engineerai/lithuanian-sentiment-MNB-tfidf-binary
lithuanian-sentiment-MNB-tfidf-binary is a text classification model from engineerai. Use it when you need a label for a piece of text. It is set up for scikit-learn. The card lists the license as apache-2.0.
A Multinomial Naïve Bayes classifier trained from scratch on 47,131 Lithuanian e-commerce reviews. Predicts binary sentiment polarity (positive / negative).
Downloads · 30 days
0
Access
Public
Updated May 18, 2026
Repo size
733 KB
Likes
0
Public
Click a slice to open those files.
.joblib366 KB · 98%
From the Hugging Face model README
A Multinomial Naïve Bayes classifier trained from scratch on 47,131 Lithuanian e-commerce reviews. Predicts binary sentiment polarity (positive / negative).
sklearn.naive_bayes.MultinomialNB, alpha = 1.0 (Laplace smoothing).min_df = 2, sublinear_tf = True) plus four engineered features (exclamation_count, review_word_count, avg_word_length, capital_count) MinMax-scaled to [0, 1].positive and negative. The corpus is naturally three-class (positive / neutral / negative) but the neutral class was dropped at training time.sample_weight = compute_sample_weight("balanced", y). SMOTE was deliberately not used because interpolating in sparse TF-IDF space produces vectors that do not correspond to plausible Lithuanian sentences.lt).| File | Purpose |
|---|---|
mnb_sentiment_binary_model.joblib | trained MNB classifier |
mnb_tfidf_binary_vectorizer.joblib | fitted TfidfVectorizer |
mnb_features_binary_scaler.joblib | fitted MinMaxScaler for engineered features |
README.md | this card |
Polarity classification of Lithuanian e-commerce reviews — for example, as a feature for downstream aggregation across the set of reviews available for a given merchant.
Three-class sentiment is not supported by this checkpoint. Domains other than Lithuanian e-commerce reviews are out of scope: the vocabulary and engineered features are dataset-specific.
Two-stage preprocessing applied to the raw review text before vectorisation:
[^a-ząčęėįšųūž\s] stripped).lt_core_news_md lemmatisation and stop-word removal.The four engineered features are computed from the raw (pre-normalisation) text so that exclamation_count, capital_count and friends are preserved.
The TF-IDF matrix is hstacked with the scaled engineered features to produce a 5,004-dimensional sparse input matrix, on which MNB is fitted with balanced sample weights.
Reported on 5-fold stratified cross-validation over the full labelled dataset (every review appears as a test instance exactly once). No held-out split.
| Metric | Value |
|---|---|
| Accuracy | 0.8952 ± 0.0039 |
| macro-F1 (headline) | 0.8618 ± 0.0043 |
| weighted-F1 | 0.9013 ± 0.0034 |
| macro-precision | 0.8320 ± 0.0044 |
| macro-recall | 0.9208 ± 0.0016 |
| ROC-AUC | 0.9743 ± 0.0011 |
| Average precision | 0.9933 ± 0.0003 |
Per-class breakdown (mean ± std across folds):
| Class | Precision | Recall | F1-score |
|---|---|---|---|
| Negative | 0.6746 ± 0.0095 | 0.9647 ± 0.0023 | 0.7939 ± 0.0057 |
| Positive | 0.9895 ± 0.0006 | 0.8768 ± 0.0055 | 0.9297 ± 0.0028 |
Aggregated confusion matrix across all five folds:
| Predicted: Negative | Predicted: Positive | |
|---|---|---|
| Actual: Negative | 9,514 | 348 |
| Actual: Positive | 4,592 | 32,677 |