{"id":13394509,"url":"https://github.com/saurabhmathur96/clickbait-detector","last_synced_at":"2025-03-13T20:31:34.851Z","repository":{"id":53477037,"uuid":"79930500","full_name":"saurabhmathur96/clickbait-detector","owner":"saurabhmathur96","description":"Detects clickbait headlines using deep learning.","archived":false,"fork":false,"pushed_at":"2020-05-27T06:21:47.000Z","size":5880,"stargazers_count":465,"open_issues_count":7,"forks_count":71,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-07-31T17:22:29.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saurabhmathur96.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-24T16:34:17.000Z","updated_at":"2024-06-22T23:11:39.000Z","dependencies_parsed_at":"2022-09-10T02:40:19.973Z","dependency_job_id":null,"html_url":"https://github.com/saurabhmathur96/clickbait-detector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saurabhmathur96%2Fclickbait-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saurabhmathur96%2Fclickbait-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saurabhmathur96%2Fclickbait-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saurabhmathur96%2Fclickbait-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saurabhmathur96","download_url":"https://codeload.github.com/saurabhmathur96/clickbait-detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243478132,"owners_count":20297197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T17:01:22.064Z","updated_at":"2025-03-13T20:31:32.818Z","avatar_url":"https://github.com/saurabhmathur96.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Clickbait Detector\n\nDetects clickbait headlines using deep learning.\n\nFind the Chrome Extension [here](https://chrome.google.com/webstore/detail/this-is-clickbait/ppklhdlfnadnlnllnenceabhldpnafjm) ( built by [rahulkapoor90](https://github.com/rahulkapoor90/This-is-Clickbait) )\n\nThe doi for this project is https://doi.org/10.17605/OSF.IO/T3UJ9 \n\n## Requirements\n- Python 2.7.12\n- Keras 1.2.1\n- Tensorflow 0.12.1\n- Numpy 1.11.1\n- NLTK 3.2.1\n\n## Getting Started\n1. Install a virtualenv in the project directory\n\n       virtualenv venv\n\n2. Activate the virtualenv\n    - On Windows:\n\n          cd venv/Scripts\n          activate\n      \n    - On Linux\n    \n          source venv/bin/activate\n\n3. Install the requirements\n\n        pip install -r requirements.txt\n        \n4. Try it out!\n    Try running one of the [examples](#examples).\n\n## Accuracy\nTraining Accuracy after 25 epochs = 93.8 % (loss = 0.1484)\n\nValidation Accuracy after 25 epochs = 90.15 % (loss = 0.2670)\n\n## Examples\n\n```\n$ python src/detect.py \"Novak Djokovic stunned as Australian Open title defence ends against Denis Istomin\"\nUsing TensorFlow backend.\nheadline is 0.33 % clickbaity\n```\n\n```\n$ python src/detect.py \"Just 22 Cute Animal Pictures You Need Right Now\"\nUsing TensorFlow backend.\nheadline is 85.38 % clickbaity\n```\n\n```\n$ python src/detect.py \" 15 Beautifully Created Doors You Need To See Before You Die. The One In Soho Blew Me Away\"\nUsing TensorFlow backend.\nheadline is 52.29 % clickbaity\n```\n\n```\n$ python src/detect.py \"French presidential candidate Emmanuel Macrons anti-system angle is a sham | Philippe Marlire\"\nUsing TensorFlow backend.\nheadline is 0.05 % clickbaity\n```\n\n## Model Summary\n```\n____________________________________________________________________________________________________\nLayer (type)                     Output Shape          Param #     Connected to                     \n====================================================================================================\nembedding_1 (Embedding)          (None, 20, 30)        195000      embedding_input_1[0][0]          \n____________________________________________________________________________________________________\nconvolution1d_1 (Convolution1D)  (None, 19, 32)        1952        embedding_1[0][0]                \n____________________________________________________________________________________________________\nbatchnormalization_1 (BatchNorma (None, 19, 32)        128         convolution1d_1[0][0]            \n____________________________________________________________________________________________________\nactivation_1 (Activation)        (None, 19, 32)        0           batchnormalization_1[0][0]       \n____________________________________________________________________________________________________\nconvolution1d_2 (Convolution1D)  (None, 18, 32)        2080        activation_1[0][0]               \n____________________________________________________________________________________________________\nbatchnormalization_2 (BatchNorma (None, 18, 32)        128         convolution1d_2[0][0]            \n____________________________________________________________________________________________________\nactivation_2 (Activation)        (None, 18, 32)        0           batchnormalization_2[0][0]       \n____________________________________________________________________________________________________\nconvolution1d_3 (Convolution1D)  (None, 17, 32)        2080        activation_2[0][0]               \n____________________________________________________________________________________________________\nbatchnormalization_3 (BatchNorma (None, 17, 32)        128         convolution1d_3[0][0]            \n____________________________________________________________________________________________________\nactivation_3 (Activation)        (None, 17, 32)        0           batchnormalization_3[0][0]       \n____________________________________________________________________________________________________\nmaxpooling1d_1 (MaxPooling1D)    (None, 1, 32)         0           activation_3[0][0]               \n____________________________________________________________________________________________________\nflatten_1 (Flatten)              (None, 32)            0           maxpooling1d_1[0][0]             \n____________________________________________________________________________________________________\ndense_1 (Dense)                  (None, 1)             33          flatten_1[0][0]                  \n____________________________________________________________________________________________________\nbatchnormalization_4 (BatchNorma (None, 1)             4           dense_1[0][0]                    \n____________________________________________________________________________________________________\nactivation_4 (Activation)        (None, 1)             0           batchnormalization_4[0][0]       \n====================================================================================================\nTotal params: 201,533\nTrainable params: 201,339\nNon-trainable params: 194\n____________________________________________________________________________________________________\n\n```\n\n\n## Data\nThe dataset consists of about 12,000 headlines half of which are clickbait.\nThe clickbait headlines were fetched from BuzzFeed, NewsWeek, The Times of India and,\nThe Huffington Post.\nThe genuine/non-clickbait headlines were fetched from The Hindu, The Guardian, The Economist,\nTechCrunch, The wall street journal, National Geographic and, The Indian Express.\n\nSome of the data was from \n[peterldowns's clickbait-classifier repository](https://github.com/peterldowns/clickbait-classifier.git)\n\n\n## Pretrained Embeddings\nI used Stanford's Glove Pretrained Embeddings PCA-ed to 30 dimensions. This sped up the\ntraining.\n\n\n## Improving accuracy\nTo improve Accuracy, \n- Increase Embedding layer dimension (Currently it is 30) - `src/preprocess_embeddings.py`\n- Use more data\n- Increase vocabulary size - `src/preprocess_text.py`\n- Increase maximum sequence length - `src/train.py`\n- Do better data cleaning\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhmathur96%2Fclickbait-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaurabhmathur96%2Fclickbait-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhmathur96%2Fclickbait-detector/lists"}