ENTUM-AI commited on
Commit
caf248e
·
verified ·
1 Parent(s): 1cc3b1e

Initial upload of DistilBERT Clickbait Classifier

Browse files
Files changed (5) hide show
  1. README.md +68 -0
  2. config.json +36 -0
  3. model.safetensors +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +14 -0
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Clickbait Classifier 🎣
2
+
3
+ This model is a fine-tuned version of `distilbert-base-uncased` trained to classify text (news headlines, article titles, video names) into two categories: **Clickbait** and **Non-Clickbait**.
4
+
5
+ It is optimized for filtering out sensationalist headlines and improving content recommendation algorithms.
6
+
7
+ ## Intended Use
8
+
9
+ The primary goal of this model is to automatically detect clickbait titles to help users and platforms prioritize high-quality informative content over misleading or exaggerated headlines.
10
+
11
+ - **Input:** Raw English text (headlines, titles, tweets).
12
+ - **Return:** A binary classification label (`Clickbait` or `Non-Clickbait`) with a confidence score.
13
+
14
+ ## Training Data
15
+
16
+ The model was fine-tuned using the `bhargavasthet/clickbait_dataset`, which contains a balanced collection of headlines explicitly labeled as clickbait (e.g., from Buzzfeed, Upworthy) and non-clickbait (e.g., from Reuters, The New York Times).
17
+
18
+ ## Performance Metrics
19
+
20
+ *(Note: These metrics will be updated after training is complete!)*
21
+
22
+ - **Accuracy:** `TBD`
23
+ - **F1 Score:** `TBD`
24
+ - **Precision:** `TBD`
25
+ - **Recall:** `TBD`
26
+ - **Evaluation Loss:** `TBD`
27
+
28
+ ## Training Constraints & Hyperparameters
29
+
30
+ The model was trained under the following conditions:
31
+ - **Base Architecture:** `distilbert-base-uncased` (chosen for speed and efficiency)
32
+ - **Maximum Sequence Length:** 128
33
+ - **Learning Rate:** 2e-05
34
+ - **Batch Size:** 64
35
+ - **Precision:** Mixed Precision (fp16)
36
+ - **Optimizer Strategy:** Early Stopping (patience=3)
37
+ - **Epochs:** 3
38
+
39
+ ## Usage 🚀
40
+
41
+ You can easily integrate this model into your applications using the Hugging Face `transformers` library pipeline:
42
+
43
+ ```python
44
+ from transformers import pipeline
45
+
46
+ # Load the clickbait classifier
47
+ classifier = pipeline("text-classification", model="ENTUM-AI/distilbert-clickbait-classifier")
48
+
49
+ # Test with a sensational headline
50
+ text_1 = "10 Bizarre Facts About Apples That Will BLOW YOUR MIND! 🍎🤯"
51
+ result_1 = classifier(text_1)
52
+ print(f"Text: '{text_1}'\nPrediction: {result_1}\n")
53
+
54
+ # Test with a normal news headline
55
+ text_2 = "Apple releases new quarterly earnings report showing 5% growth."
56
+ result_2 = classifier(text_2)
57
+ print(f"Text: '{text_2}'\nPrediction: {result_2}")
58
+ ```
59
+
60
+ ## Expected Output format:
61
+ ```json
62
+ [{'label': 'Clickbait', 'score': 0.9921}]
63
+ ```
64
+
65
+ ## Potential Applications
66
+ - 📰 **News Aggregators:** Filter out low-quality clickbait articles.
67
+ - 📱 **Social Media Feeds:** Demote clickbait posts in recommendation algorithms.
68
+ - ✉️ **Email Spam Filters:** Detect clickbait-style subject lines in promotional emails.
config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation": "gelu",
3
+ "architectures": [
4
+ "DistilBertForSequenceClassification"
5
+ ],
6
+ "attention_dropout": 0.1,
7
+ "bos_token_id": null,
8
+ "dim": 768,
9
+ "dropout": 0.1,
10
+ "dtype": "float32",
11
+ "eos_token_id": null,
12
+ "hidden_dim": 3072,
13
+ "id2label": {
14
+ "0": "Non-Clickbait",
15
+ "1": "Clickbait"
16
+ },
17
+ "initializer_range": 0.02,
18
+ "label2id": {
19
+ "Clickbait": 1,
20
+ "Non-Clickbait": 0
21
+ },
22
+ "max_position_embeddings": 512,
23
+ "model_type": "distilbert",
24
+ "n_heads": 12,
25
+ "n_layers": 6,
26
+ "pad_token_id": 0,
27
+ "problem_type": "single_label_classification",
28
+ "qa_dropout": 0.1,
29
+ "seq_classif_dropout": 0.2,
30
+ "sinusoidal_pos_embds": false,
31
+ "tie_weights_": true,
32
+ "tie_word_embeddings": true,
33
+ "transformers_version": "5.1.0",
34
+ "use_cache": false,
35
+ "vocab_size": 30522
36
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2dad6976aef8704c135ed133c272c9c6bae7feed0e108fef05269e3abe577e8
3
+ size 267832560
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "cls_token": "[CLS]",
4
+ "do_lower_case": true,
5
+ "is_local": false,
6
+ "mask_token": "[MASK]",
7
+ "model_max_length": 512,
8
+ "pad_token": "[PAD]",
9
+ "sep_token": "[SEP]",
10
+ "strip_accents": null,
11
+ "tokenize_chinese_chars": true,
12
+ "tokenizer_class": "BertTokenizer",
13
+ "unk_token": "[UNK]"
14
+ }