Milan97/ClickbaitDetectionModel
08
1---2tags:3- autotrain4- text-classification5base_model: sentence-transformers/all-mpnet-base-v26widget:7- text: I love AutoTrain8language:9- en10pipeline_tag: text-classification11---12 13# Clickbait Detection Model14 15This is a **custom-trained text classification model** created using Hugging Face **AutoTrain**. The model is designed to classify text into two categories:16- **Clickbait**17- **Not Clickbait**18 19The training was conducted using a fine-tuned version of the `sentence-transformers/all-mpnet-base-v2` base model, which is well-suited for text classification tasks.20 21---22 23## Model Details24 25- **Base Model**: [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2)26- **Problem Type**: Text Classification27- **Language**: English (`en`)28- **Pipeline Tag**: text-classification29- **Tags**: autotrain, text-classification30 31---32 33## Usage34 35You can use this model with Hugging Face’s `transformers` library to classify text into `clickbait` or `not clickbait`.36 37### Example Code38```python39from transformers import AutoTokenizer, AutoModelForSequenceClassification40 41# Load tokenizer and model42model_name = "Milan97/ClickbaitDetectionModel"43tokenizer = AutoTokenizer.from_pretrained(model_name)44model = AutoModelForSequenceClassification.from_pretrained(model_name)45 46# Input text47text = "You won’t believe what happened next!"48 49# Tokenize and perform inference50inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)51outputs = model(**inputs)52 53# Get predicted label and confidence54logits = outputs.logits55predicted_class = logits.argmax(dim=1).item()56confidence = logits.softmax(dim=1).max().item()57 58# Label mapping59labels = {0: "Not Clickbait", 1: "Clickbait"}60 61print(f"Text: {text}")62print(f"Prediction: {labels[predicted_class]} (Confidence: {confidence:.2f})")