Program 6
Program 6
sentences = [
"This is a great product! I love it.",
"I am very disappointed with this service.",
"The weather is not okay today.but still gotta adjust the place"
]
results = classifier(sentences)
for sentence, result in zip(sentences, results):
print(f"'{sentence}' -> Label: {result['label']}, Score: {result['score']:.3f}")
OUTPUT:
Device set to use cpu
'This is a great product! I love it.' -> Label: POSITIVE, Score: 1.000
'I am very disappointed with this service.' -> Label: NEGATIVE, Score: 1.000
'The weather is not okay today.but still gotta adjust the place' -> Label:
NEGATIVE, Score: 0.990