Views
No views yet
| 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-classifier1from adaptive_classifier import AdaptiveClassifier
2
3# Load the model
4classifier = AdaptiveClassifier.from_pretrained("MemChainAI/adaptive-sentiment-classifier")
5
6# Make predictions
7text = "This is a great product!"
8predictions = classifier.predict(text)
9
10# Get top prediction
11label, confidence = predictions[0]
12print(f"Sentiment: {label} ({confidence:.3f})")1import requests
2
3response = requests.post(
4 "http://localhost:8033/model/sentiment/predict",
5 json={"text": "Your text here", "k": 3}
6)
7result = response.json()1texts = [
2 "I love this!",
3 "This is terrible.",
4 "The system processes data automatically."
5]
6
7# Batch prediction
8batch_results = classifier.predict_batch(texts)
9for i, predictions in enumerate(batch_results):
10 label, confidence = predictions[0]
11 print(f"Text {i+1}: {label} ({confidence:.3f})")1@misc{adaptive-sentiment-classifier-2025,
2 title={Adaptive Sentiment Classifier},
3 author={MemChain AI},
4 year={2025},
5 publisher={Hugging Face},
6 url={https://huggingface.co/MemChainAI/adaptive-sentiment-classifier}
7}