Text Classification
Transformers
English
sentiment-analysis
classification
from-scratch
multi-domain
Eval Results (legacy)
Instructions to use LH-Tech-AI/VibeCheck_v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LH-Tech-AI/VibeCheck_v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="LH-Tech-AI/VibeCheck_v1")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LH-Tech-AI/VibeCheck_v1", dtype="auto") - Notebooks
- Google Colab
- Kaggle
| import torch | |
| from transformers import AutoTokenizer, AutoModelForSequenceClassification | |
| class VibeCheckInference: | |
| def __init__(self, model_path): | |
| self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
| self.tokenizer = AutoTokenizer.from_pretrained(model_path) | |
| self.model = AutoModelForSequenceClassification.from_pretrained(model_path).to(self.device) | |
| self.model.eval() | |
| def analyze(self, text): | |
| inputs = self.tokenizer( | |
| text, | |
| return_tensors="pt", | |
| padding=True, | |
| truncation=True, | |
| max_length=128 | |
| ).to(self.device) | |
| with torch.no_grad(): | |
| outputs = self.model(**inputs) | |
| probs = torch.nn.functional.softmax(outputs.logits, dim=-1) | |
| conf, pred = torch.max(probs, dim=-1) | |
| result = "POSITIVE" if pred.item() == 1 else "NEGATIVE" | |
| return { | |
| "text": text, | |
| "label": result, | |
| "confidence": f"{conf.item() * 100:.2f}%" | |
| } | |
| # Usage | |
| if __name__ == "__main__": | |
| # Point this to your unzipped folder | |
| engine = VibeCheckInference("./VibeCheck_v1_HF") | |
| sample = "Did you see the new movie?' B: 'Yeah, it was okay, but the ending felt a bit rushed.' A: 'I totally agree, it could have been better.'" | |
| prediction = engine.analyze(sample) | |
| print(f"Result: {prediction['label']} | Confidence: {prediction['confidence']}") |