File size: 1,837 Bytes
e791ddc
 
 
 
 
 
b2b8fa1
 
 
 
 
 
 
 
 
 
 
 
 
 
e791ddc
 
b2b8fa1
 
 
 
 
 
 
 
 
 
 
 
 
e791ddc
b2b8fa1
 
 
e791ddc
b2b8fa1
4ea7558
b2b8fa1
 
e791ddc
b2b8fa1
 
e791ddc
b2b8fa1
 
 
e791ddc
b2b8fa1
 
 
 
e791ddc
b2b8fa1
 
e791ddc
b2b8fa1
 
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
tags:
- autotrain
- text-classification
base_model: sentence-transformers/all-mpnet-base-v2
widget:
- text: I love AutoTrain
language:
- en
pipeline_tag: text-classification
---

# Clickbait Detection Model

This is a **custom-trained text classification model** created using Hugging Face **AutoTrain**. The model is designed to classify text into two categories:
- **Clickbait**
- **Not Clickbait**

The 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.

---

## Model Details

- **Base Model**: [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2)
- **Problem Type**: Text Classification
- **Language**: English (`en`)
- **Pipeline Tag**: text-classification
- **Tags**: autotrain, text-classification

---

## Usage

You can use this model with Hugging Face’s `transformers` library to classify text into `clickbait` or `not clickbait`.

### Example Code
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification

# Load tokenizer and model
model_name = "Milan97/ClickbaitDetectionModel"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# Input text
text = "You won’t believe what happened next!"

# Tokenize and perform inference
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
outputs = model(**inputs)

# Get predicted label and confidence
logits = outputs.logits
predicted_class = logits.argmax(dim=1).item()
confidence = logits.softmax(dim=1).max().item()

# Label mapping
labels = {0: "Not Clickbait", 1: "Clickbait"}

print(f"Text: {text}")
print(f"Prediction: {labels[predicted_class]} (Confidence: {confidence:.2f})")