├── README.md ├── fake_news_code_d.ipynb └── fake_news_code_d.py /README.md: -------------------------------------------------------------------------------- 1 | # Fake-News-Detection-Project 2 | Final Year College Project with Project Synopsis, Report, PPT, Code and Documents 3 | 4 | ### Project Youtube Explanation : https://youtu.be/DQRZHOpU9bU 5 | 6 | ![Screenshot 2021-12-03 at 12 25 50 AM](https://user-images.githubusercontent.com/28294942/144485388-ab0cb531-51b8-457e-8984-f2a54aeb4ea3.png) 7 | 8 | ### PPT : [CLICK](https://docs.google.com/presentation/d/e/2PACX-1vRN-vXLHXot00PeBUpKUB_dnPci41lBuLDHj6cr5P7Zgza-MUIc7xiTt0eQZHQ-og-qOzBC1jhUG6uW/pub?start=true&loop=false&delayms=2000) 9 | 10 | ### RESEARCH BASE PAPER: [Click](https://www.hindawi.com/journals/complexity/2020/8885861/) 11 | 12 | ### PROJECT DEMO CODE: [Click](https://github.com/Vatshayan/Fake-News-Detection-Project/blob/main/fake_news_code_d.ipynb) [I have made code private, if you need then mail me I will send you asap] 13 | 14 | Project is New and Unique (Totally based on Research paper with new idea and great result) 15 | 16 | 17 | ### Abstract 18 | The advent of the World Wide Web and the rapid adoption of social media platforms (such as Facebook and Twitter) paved the way for information dissemination that has never been witnessed in the human history before. With the current usage of social media platforms, consumers are creating and sharing more information than ever before, some of which are misleading with no relevance to reality. Automated classification of a text article as misinformation or disinformation is a challenging task. Even an expert in a particular domain has to explore multiple aspects before giving a verdict on the truthfulness of an article. In this work, we propose to use machine learning ensemble approach for automated classification of news articles. Our study explores different textual properties that can be used to distinguish fake contents from real. By using those properties, we train a combination of different machine learning algorithms using various ensemble methods and evaluate their performance on 4 real world datasets. Experimental evaluation confirms the superior performance of our proposed ensemble learner approach 19 | 20 | Project is in Python Programming. 21 | 22 | ______________________________________________________________________________________________________________ 23 |

नमस्ते (Namaste) 🙏🏻 , I'm Shivam Vatshayan !

24 | 25 | **You Can use this Beautiful Project for your college Project and get good marks too.** 26 | 27 | Email me Now **vatshayan007@gmail.com** to get this Full Project Code, PPT, Report, Synopsis, Video Presentation and Research paper of this Project. 28 | 29 | 💌 Feel free to contact me for any kind of help on any projects. 30 | 31 | ### HOW TO RUN THE PROJECT 32 | ⚡ Email me at **vatshayan007@gmail.com** to get a detailed Guide report with Code to run the project with source Code. 33 | 34 | ### Need Code, Documents & Explanation video ? 35 | 36 | ## How to Reach me : 37 | 38 | ### Mail : vatshayan007@gmail.com 39 | 40 | ### WhatsApp: **+91 9310631437** (Helping 24*7) **[CHAT](https://wa.me/message/CHWN2AHCPMAZK1)** 41 | 42 | ### Website : https://www.finalproject.in/ 43 | 44 | ### 1000 Computer Science Projects : https://www.computer-science-project.in/ 45 | 46 | Mail/Message me for Projects Help 🙏🏻 47 | -------------------------------------------------------------------------------- /fake_news_code_d.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "fake news code_d.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "code", 20 | "metadata": { 21 | "id": "UzRteWfLyDwf" 22 | }, 23 | "source": [ 24 | "# This Python 3 environment comes with many helpful analytics libraries installed\n", 25 | "# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n", 26 | "# For example, here's several helpful packages to load\n", 27 | "\n", 28 | "import numpy as np # linear algebra\n", 29 | "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n", 30 | "\n", 31 | "# Input data files are available in the read-only \"../input/\" directory\n", 32 | "# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n", 33 | "\n" 34 | ], 35 | "execution_count": 35, 36 | "outputs": [] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "metadata": { 41 | "id": "wdEW4Ow5bSpr" 42 | }, 43 | "source": [ 44 | "# Modelling Algorithms\n", 45 | "from sklearn.naive_bayes import MultinomialNB\n", 46 | "from sklearn.linear_model import LogisticRegression\n", 47 | "from sklearn.linear_model import PassiveAggressiveClassifier\n", 48 | "\n", 49 | "# Modelling Helpers\n", 50 | "from sklearn.model_selection import train_test_split\n", 51 | "from sklearn.feature_extraction.text import TfidfVectorizer\n", 52 | "from sklearn.feature_extraction.text import CountVectorizer\n", 53 | "from sklearn import metrics\n", 54 | "\n", 55 | "# Computations\n", 56 | "import itertools\n", 57 | "\n", 58 | "# Visualization\n", 59 | "import matplotlib.pyplot as plt" 60 | ], 61 | "execution_count": 36, 62 | "outputs": [] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "metadata": { 67 | "id": "PP6IetIfv7pv" 68 | }, 69 | "source": [ 70 | "test = pd.read_csv (\"test.csv\")\n", 71 | "submit = pd.read_csv (\"submit.csv\")" 72 | ], 73 | "execution_count": 37, 74 | "outputs": [] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "metadata": { 79 | "id": "YBLqrTSKxEVg" 80 | }, 81 | "source": [ 82 | "train = pd.read_csv(\"test.csv\")" 83 | ], 84 | "execution_count": 38, 85 | "outputs": [] 86 | }, 87 | { 88 | "cell_type": "code", 89 | "metadata": { 90 | "colab": { 91 | "base_uri": "https://localhost:8080/", 92 | "height": 204 93 | }, 94 | "id": "T7lxKKMj1czM", 95 | "outputId": "972a64e9-abbb-49a2-8344-085fb0471018" 96 | }, 97 | "source": [ 98 | "train.head()" 99 | ], 100 | "execution_count": 39, 101 | "outputs": [ 102 | { 103 | "output_type": "execute_result", 104 | "data": { 105 | "text/html": [ 106 | "
\n", 107 | "\n", 120 | "\n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | "
idtitleauthortext
020800Specter of Trump Loosens Tongues, if Not Purse...David StreitfeldPALO ALTO, Calif. — After years of scorning...
120801Russian warships ready to strike terrorists ne...NaNRussian warships ready to strike terrorists ne...
220802#NoDAPL: Native American Leaders Vow to Stay A...Common DreamsVideos #NoDAPL: Native American Leaders Vow to...
320803Tim Tebow Will Attempt Another Comeback, This ...Daniel VictorIf at first you don’t succeed, try a different...
420804Keiser Report: Meme Wars (E995)Truth Broadcast Network42 mins ago 1 Views 0 Comments 0 Likes 'For th...
\n", 168 | "
" 169 | ], 170 | "text/plain": [ 171 | " id ... text\n", 172 | "0 20800 ... PALO ALTO, Calif. — After years of scorning...\n", 173 | "1 20801 ... Russian warships ready to strike terrorists ne...\n", 174 | "2 20802 ... Videos #NoDAPL: Native American Leaders Vow to...\n", 175 | "3 20803 ... If at first you don’t succeed, try a different...\n", 176 | "4 20804 ... 42 mins ago 1 Views 0 Comments 0 Likes 'For th...\n", 177 | "\n", 178 | "[5 rows x 4 columns]" 179 | ] 180 | }, 181 | "metadata": { 182 | "tags": [] 183 | }, 184 | "execution_count": 39 185 | } 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "metadata": { 191 | "colab": { 192 | "base_uri": "https://localhost:8080/" 193 | }, 194 | "id": "3U5rzwM2z6w7", 195 | "outputId": "89ff7b91-5fbf-47e1-d585-76af466b35cd" 196 | }, 197 | "source": [ 198 | "print(f\"Train Shape : {train.shape}\")\n", 199 | "print(f\"Test Shape : {test.shape}\")\n", 200 | "print(f\"Submit Shape : {submit.shape}\")" 201 | ], 202 | "execution_count": 40, 203 | "outputs": [ 204 | { 205 | "output_type": "stream", 206 | "text": [ 207 | "Train Shape : (5200, 4)\n", 208 | "Test Shape : (5200, 4)\n", 209 | "Submit Shape : (5200, 2)\n" 210 | ], 211 | "name": "stdout" 212 | } 213 | ] 214 | }, 215 | { 216 | "cell_type": "code", 217 | "metadata": { 218 | "colab": { 219 | "base_uri": "https://localhost:8080/" 220 | }, 221 | "id": "RGGMXSj0z-yA", 222 | "outputId": "32b26ca4-dc80-47e4-bca5-7890fdbca596" 223 | }, 224 | "source": [ 225 | "train.info()" 226 | ], 227 | "execution_count": 41, 228 | "outputs": [ 229 | { 230 | "output_type": "stream", 231 | "text": [ 232 | "\n", 233 | "RangeIndex: 5200 entries, 0 to 5199\n", 234 | "Data columns (total 4 columns):\n", 235 | " # Column Non-Null Count Dtype \n", 236 | "--- ------ -------------- ----- \n", 237 | " 0 id 5200 non-null int64 \n", 238 | " 1 title 5078 non-null object\n", 239 | " 2 author 4697 non-null object\n", 240 | " 3 text 5193 non-null object\n", 241 | "dtypes: int64(1), object(3)\n", 242 | "memory usage: 162.6+ KB\n" 243 | ], 244 | "name": "stdout" 245 | } 246 | ] 247 | }, 248 | { 249 | "cell_type": "code", 250 | "metadata": { 251 | "colab": { 252 | "base_uri": "https://localhost:8080/" 253 | }, 254 | "id": "HYlIaspqz-s4", 255 | "outputId": "98b0b2a2-a2ad-4441-fb21-9ed9cc6322eb" 256 | }, 257 | "source": [ 258 | "train.isnull().sum()" 259 | ], 260 | "execution_count": 42, 261 | "outputs": [ 262 | { 263 | "output_type": "execute_result", 264 | "data": { 265 | "text/plain": [ 266 | "id 0\n", 267 | "title 122\n", 268 | "author 503\n", 269 | "text 7\n", 270 | "dtype: int64" 271 | ] 272 | }, 273 | "metadata": { 274 | "tags": [] 275 | }, 276 | "execution_count": 42 277 | } 278 | ] 279 | }, 280 | { 281 | "cell_type": "code", 282 | "metadata": { 283 | "colab": { 284 | "base_uri": "https://localhost:8080/" 285 | }, 286 | "id": "vEtMre7pz6Nh", 287 | "outputId": "3a7ef26e-1a15-4777-af43-472167b19a50" 288 | }, 289 | "source": [ 290 | "train.dtypes.value_counts()" 291 | ], 292 | "execution_count": 43, 293 | "outputs": [ 294 | { 295 | "output_type": "execute_result", 296 | "data": { 297 | "text/plain": [ 298 | "object 3\n", 299 | "int64 1\n", 300 | "dtype: int64" 301 | ] 302 | }, 303 | "metadata": { 304 | "tags": [] 305 | }, 306 | "execution_count": 43 307 | } 308 | ] 309 | }, 310 | { 311 | "cell_type": "code", 312 | "metadata": { 313 | "id": "NtMz6Lli0C_t" 314 | }, 315 | "source": [ 316 | "test=test.fillna(' ')\n", 317 | "train=train.fillna(' ')" 318 | ], 319 | "execution_count": 44, 320 | "outputs": [] 321 | }, 322 | { 323 | "cell_type": "code", 324 | "metadata": { 325 | "id": "5umpCfm40C86" 326 | }, 327 | "source": [ 328 | "# Create a column with all the data available\n", 329 | "test['total']=test['title']+' '+test['author']+' '+test['text']\n", 330 | "train['total']=train['title']+' '+train['author']+' '+train['text']" 331 | ], 332 | "execution_count": 45, 333 | "outputs": [] 334 | }, 335 | { 336 | "cell_type": "code", 337 | "metadata": { 338 | "colab": { 339 | "base_uri": "https://localhost:8080/", 340 | "height": 408 341 | }, 342 | "id": "wHCDs1mp0C6B", 343 | "outputId": "890d0b78-55d3-4545-e31b-49b246ec344b" 344 | }, 345 | "source": [ 346 | "# Have a glance at our training set\n", 347 | "train.info()\n", 348 | "train.head()" 349 | ], 350 | "execution_count": 46, 351 | "outputs": [ 352 | { 353 | "output_type": "stream", 354 | "text": [ 355 | "\n", 356 | "RangeIndex: 5200 entries, 0 to 5199\n", 357 | "Data columns (total 5 columns):\n", 358 | " # Column Non-Null Count Dtype \n", 359 | "--- ------ -------------- ----- \n", 360 | " 0 id 5200 non-null int64 \n", 361 | " 1 title 5200 non-null object\n", 362 | " 2 author 5200 non-null object\n", 363 | " 3 text 5200 non-null object\n", 364 | " 4 total 5200 non-null object\n", 365 | "dtypes: int64(1), object(4)\n", 366 | "memory usage: 203.2+ KB\n" 367 | ], 368 | "name": "stdout" 369 | }, 370 | { 371 | "output_type": "execute_result", 372 | "data": { 373 | "text/html": [ 374 | "
\n", 375 | "\n", 388 | "\n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | "
idtitleauthortexttotal
020800Specter of Trump Loosens Tongues, if Not Purse...David StreitfeldPALO ALTO, Calif. — After years of scorning...Specter of Trump Loosens Tongues, if Not Purse...
120801Russian warships ready to strike terrorists ne...Russian warships ready to strike terrorists ne...Russian warships ready to strike terrorists ne...
220802#NoDAPL: Native American Leaders Vow to Stay A...Common DreamsVideos #NoDAPL: Native American Leaders Vow to...#NoDAPL: Native American Leaders Vow to Stay A...
320803Tim Tebow Will Attempt Another Comeback, This ...Daniel VictorIf at first you don’t succeed, try a different...Tim Tebow Will Attempt Another Comeback, This ...
420804Keiser Report: Meme Wars (E995)Truth Broadcast Network42 mins ago 1 Views 0 Comments 0 Likes 'For th...Keiser Report: Meme Wars (E995) Truth Broadcas...
\n", 442 | "
" 443 | ], 444 | "text/plain": [ 445 | " id ... total\n", 446 | "0 20800 ... Specter of Trump Loosens Tongues, if Not Purse...\n", 447 | "1 20801 ... Russian warships ready to strike terrorists ne...\n", 448 | "2 20802 ... #NoDAPL: Native American Leaders Vow to Stay A...\n", 449 | "3 20803 ... Tim Tebow Will Attempt Another Comeback, This ...\n", 450 | "4 20804 ... Keiser Report: Meme Wars (E995) Truth Broadcas...\n", 451 | "\n", 452 | "[5 rows x 5 columns]" 453 | ] 454 | }, 455 | "metadata": { 456 | "tags": [] 457 | }, 458 | "execution_count": 46 459 | } 460 | ] 461 | }, 462 | { 463 | "cell_type": "code", 464 | "metadata": { 465 | "id": "hMkU_ZNd9qxc" 466 | }, 467 | "source": [ 468 | "" 469 | ], 470 | "execution_count": null, 471 | "outputs": [] 472 | }, 473 | { 474 | "cell_type": "code", 475 | "metadata": { 476 | "id": "RAdYCyNQOkCT" 477 | }, 478 | "source": [ 479 | "" 480 | ], 481 | "execution_count": null, 482 | "outputs": [] 483 | }, 484 | { 485 | "cell_type": "markdown", 486 | "metadata": { 487 | "id": "juOiuukbOjrY" 488 | }, 489 | "source": [ 490 | "Hi WAIT ............\n", 491 | "\n", 492 | "This is Just Small Demo. \n", 493 | "\n", 494 | "Full Code is long... \n", 495 | "\n", 496 | "Full Project is Available with Porject Report and PPT.\n", 497 | "\n", 498 | "##Mail me at **Vatshayan007@mail.com** to get this project." 499 | ] 500 | }, 501 | { 502 | "cell_type": "code", 503 | "metadata": { 504 | "id": "m42H-lyNOjY1" 505 | }, 506 | "source": [ 507 | "" 508 | ], 509 | "execution_count": null, 510 | "outputs": [] 511 | }, 512 | { 513 | "cell_type": "code", 514 | "metadata": { 515 | "id": "_PzDiGs9OjVt" 516 | }, 517 | "source": [ 518 | "" 519 | ], 520 | "execution_count": null, 521 | "outputs": [] 522 | } 523 | ] 524 | } -------------------------------------------------------------------------------- /fake_news_code_d.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """fake news code_d.ipynb 3 | 4 | Automatically generated by Colaboratory. 5 | 6 | 7 | 8 | # This Python 3 environment comes with many helpful analytics libraries installed 9 | # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python 10 | # For example, here's several helpful packages to load 11 | 12 | import numpy as np # linear algebra 13 | import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) 14 | 15 | # Input data files are available in the read-only "../input/" directory 16 | # For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory 17 | 18 | # Modelling Algorithms 19 | from sklearn.naive_bayes import MultinomialNB 20 | from sklearn.linear_model import LogisticRegression 21 | from sklearn.linear_model import PassiveAggressiveClassifier 22 | 23 | # Modelling Helpers 24 | from sklearn.model_selection import train_test_split 25 | from sklearn.feature_extraction.text import TfidfVectorizer 26 | from sklearn.feature_extraction.text import CountVectorizer 27 | from sklearn import metrics 28 | 29 | # Computations 30 | import itertools 31 | 32 | # Visualization 33 | import matplotlib.pyplot as plt 34 | 35 | test = pd.read_csv ("test.csv") 36 | submit = pd.read_csv ("submit.csv") 37 | 38 | train = pd.read_csv("test.csv") 39 | 40 | train.head() 41 | 42 | print(f"Train Shape : {train.shape}") 43 | print(f"Test Shape : {test.shape}") 44 | print(f"Submit Shape : {submit.shape}") 45 | 46 | train.info() 47 | 48 | train.isnull().sum() 49 | 50 | train.dtypes.value_counts() 51 | 52 | test=test.fillna(' ') 53 | train=train.fillna(' ') 54 | 55 | # Create a column with all the data available 56 | test['total']=test['title']+' '+test['author']+' '+test['text'] 57 | train['total']=train['title']+' '+train['author']+' '+train['text'] 58 | 59 | # Have a glance at our training set 60 | train.info() 61 | train.head() 62 | 63 | 64 | 65 | 66 | 67 | """Hi WAIT ............ 68 | 69 | This is Just Small Demo. 70 | 71 | Full Code is long... 72 | 73 | Full Project is Available with Porject Report and PPT. 74 | 75 | ##Mail me at **Vatshayan007@mail.com** to get this project. 76 | """ 77 | 78 | 79 | 80 | --------------------------------------------------------------------------------