File size: 736 Bytes
549a364
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# test_model.py

from transformers import pipeline

def test_sentiment():
    # Load the model from Hugging Face Hub
    # Replace with your model path
    classifier = pipeline(
        "sentiment-analysis", 
        model="shaheerawan3/Vibescribe"
    )
    
    # Test texts
    texts = [
        "This movie was amazing! I loved every minute of it.",
        "What a terrible waste of time. I hated it.",
        "It was okay, not great but not bad either."
    ]
    
    # Make predictions
    for text in texts:
        result = classifier(text)[0]
        print(f"\nText: {text}")
        print(f"Sentiment: {result['label']}")
        print(f"Confidence: {result['score']:.4f}")

if __name__ == "__main__":
    test_sentiment()