Views
No views yet
distilbert-base-uncasedtransformers, datasetsLABEL_0: NOT CLICKBAIT (Genuine / Standard News)LABEL_1: CLICKBAIT (Sensationalized / Engagement Bait)1from transformers import pipeline
2
3# Load classifier
4classifier = pipeline("text-classification", model="Saman11233/clickbait-distilbert-detector")
5
6# Test sample
7sample_headline = "10 Secrets Doctors Don't Want You to Know!"
8result = classifier(sample_headline)
9
10print(result)1from transformers import pipeline
2
3classifier = pipeline("text-classification", model="Saman11233/clickbait-distilbert-detector")
4
5user_input = input("Enter headline: ")
6if user_input.strip():
7 res = classifier(user_input)[0]
8 label = "CLICKBAIT" if res["label"] == "LABEL_1" else "NOT CLICKBAIT"
9 print(f"Prediction: {label} ({res['score']*100:.2f}% confidence)")