kandi background

Build AI fake news detection using machine learning

by kandikits

Fake News Detector AI fake news detector helps detect fake news through binary classification techniques and helps build better experiences by controlling the flow of disinformation in politics, businesses, climate change, and more. It's built on top of various powerful machine learning libraries. The tool works by training a neural network to spot fake articles based on their text content. When you run your own data through the tool, it gives you back a list of articles that it thinks are likely to be fake. You can then train the model further or decide if those results are acceptable or not. In addition to identifying fake news, this model can also be trained to identify real news. This allows you to compare the model's performance across different domains (e.g., politics vs. sports). The following installer and deployment instructions will walk you through the steps of creating an AI fake news detector by using fakenews-detection, jupyter, vscode, and pandas. We will use fake news detection libraries (having fully modifiable source code) to customize and build a simple classifier that can detect fake news articles. kandi kit provides you with a fully deployable AI Fake News Detector. Source code included so that you can customize it for your requirement.

Tutorial and certification - how to build fake news detection using machine learning

Watch this self-guided tutorial on how you can use training data, NLP pipeline, TF-IDF vectorizer, and text classifier to build your own AI fake new detector. Tag us on social media with a screenshot or video of your working application for a chance to be featured as an Open Source champion and get a verified badge.

Kit Deployment Instructions

For Windows OS, Download, extract and double-click the kit installer file to install the kit. Note: Do ensure to extract the zip file before running it. The installation may take from 2 to 10 minutes based on bandwidth. 1. When you're prompted during the installation of the kit, press Y to launch the app automatically and execute cells in the notebook by selecting Cell --> Run All from Menu bar 2. To run the app manually, press N when you're prompted and locate the zip file kit_installer.zip 3. Extract the zip file and navigate to the directory fake-news-detection-main 4. Open command prompt in the extracted directory fake-news-detection and run the command jupyter notebook For other Operating System, 1. Click here to install python 2. Click here to download the repository 3. Extract the zip file and navigate to the directory fakenews-detection-main 4. Open terminal in the extracted directory fakenews-detection-main 5. Install dependencies by executing the command pip install -r requirements.txt 6. Run the command jupyter notebooks for this kit e.g. Installation, Dependencies etc.

Kit Solution Source

Fake News Predictor created using this kit are added in this section. The entire solution is available as a package to download from the source code repository.

Development Environment

VSCode and Jupyter Notebook are used for development and debugging. Jupyter Notebook is a web based interactive environment often used for experiments, whereas VSCode is used to get a typical experience of IDE for developers. Jupyter Notebook is used for our development.

Exploratory Data Analysis

For extensive analysis and exploration of data, and to deal with arrays, these libraries are used. They are also used for performing scientific computation and data manipulation.

Text mining

Libraries in this group are used for analysis and processing of unstructured natural language. The data, as in its original form aren't used as it has to go through processing pipeline to become suitable for applying machine learning techniques and algorithms.

Machine Learning

Machine learning libraries and frameworks here are helpful in providing state-of-the-art solutions using Machine learning.

Instruction to Run

Follow the below instructions to run the solution. 1. Locate and open the FakeNewsDetection-starter.ipynb notebook from the Jupyter Notebook browser window. 2. Execute cells in the notebook by selecting Cell --> Run All from Menu bar For configuring with your data, 1. Place your csv data file with columns as 'text' and 'label' containing the 'text data' and 'predicted label' respectively as in the sample 'fakenews.csv' in the fakenews-detection-master directory from the kit_installer.bat location. 2. Replace the filename in the 'Variables' section of the notebook to your csv file name. 3. Execute cells in the notebook by selecting Cell --> Run All from Menu bar. Input file: fakenews.csv - contains sample data for Training and Predicting fake news. It has 2 columns : 'text' and 'label'. Attributes of fakenews.csv dataset: 1.text: text of the article 2.label: a label that marks the article as potentially unreliable with 2 values '1' and '0' 1: fake 0: true You can additionally try developing more ML models and include more enhancements for additional scores. For any support, you can direct message us at #help-with-kandi-kits

Troubleshooting

1. While running batch file, if you encounter Windows protection alert, select More info --> Run anyway 2. During kit installer, if you encounter Windows security alert, click Allow

Support

For any support, you can direct message us at #help-with-kandi-kits