Downloads · 30 days
6
12% of all-time downloads
1hugh/Herbal-Sentiment-BERT
Herbal-Sentiment-BERT is a text classification model from 1hugh. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This model is a fine-tuned version of bert-base-chinese for sentiment analysis in the specific domain of Chinese herbal medicine e-commerce reviews. It is designed to classify customer reviews into three sentiment cat…
Downloads · 30 days
6
12% of all-time downloads
All-time downloads
50
Public
Parameters
102M
409 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors409 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of bert-base-chinese for sentiment analysis in the specific domain of Chinese herbal medicine e-commerce reviews. It is designed to classify customer reviews into three sentiment categories: Negative (0), Neutral (1), and Positive (2).
The model was specifically optimized to handle highly imbalanced datasets (where positive samples dominate) by capturing deep semantic relationships and domain-specific terminology (e.g., specific herbal names and distinct symptom descriptions), effectively mitigating the risk of overfitting to the majority class.
The model was fine-tuned on a dataset comprising over 210,000 authentic user reviews from herbal medicine e-commerce platforms.
During the evaluation on a held-out test set (representing the imbalanced distribution), the model achieved the following performance, significantly outperforming sequence-based baselines (e.g., Bi-LSTM + Attention) in minority class identification:
You can easily use this model with the transformers library:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("1hugh/Herbal-Sentiment-BERT")
model = AutoModelForSequenceClassification.from_pretrained("1hugh/Herbal-Sentiment-BERT")
text = "这当归发霉了,味道极差!"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
predictions = outputs.logits.argmax(dim=-1)
# Labels: 0 -> Negative, 1 -> Neutral, 2 -> Positive
print(f"Predicted class: {predictions.item()}")