SetFit/tweet_sentiment_extraction
Viewer • Updated • 31k • 497 • 11
An improved sentiment analysis model using the adaptive-classifier library, designed for accurate classification of positive, negative, and neutral sentiments with special focus on technical and informational content.
This model is based on the adaptive-classifier library and uses DistilBERT as the underlying transformer. It has been specifically trained to properly classify:
| Text | Expected | Predicted | ✓ |
|---|---|---|---|
| "Granite Guardian 4 is a type of AI model..." | neutral | neutral | ✅ |
| "Do you know what Granite Guardian 4 is?" | neutral | neutral | ✅ |
| "Learning is a process of gaining knowledge..." | neutral | neutral | ✅ |
| "I love this new technology!" | positive | positive | ✅ |
| "This is terrible and I hate it." | negative | negative | ✅ |
pip install adaptive-classifier
from adaptive_classifier import AdaptiveClassifier
# Load the model
classifier = AdaptiveClassifier.from_pretrained("MemChainAI/adaptive-sentiment-classifier")
# Make predictions
text = "This is a great product!"
predictions = classifier.predict(text)
# Get top prediction
label, confidence = predictions[0]
print(f"Sentiment: {label} ({confidence:.3f})")
This model is designed to work with the MemChain Models API:
import requests
response = requests.post(
"http://localhost:8033/model/sentiment/predict",
json={"text": "Your text here", "k": 3}
)
result = response.json()
texts = [
"I love this!",
"This is terrible.",
"The system processes data automatically."
]
# Batch prediction
batch_results = classifier.predict_batch(texts)
for i, predictions in enumerate(batch_results):
label, confidence = predictions[0]
print(f"Text {i+1}: {label} ({confidence:.3f})")
@misc{adaptive-sentiment-classifier-2025,
title={Adaptive Sentiment Classifier},
author={MemChain AI},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/MemChainAI/adaptive-sentiment-classifier}
}
MIT License - see LICENSE file for details.
For questions, issues, or contributions, please visit the MemChain AI.