Build AI fake news detection using machine learning
https://kandi.openweaver.com/collections/techforgood2022/spotting-fake-news
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.
- 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
- To run the app manually, press N when you're prompted and locate the zip file 'kit_installer.zip'
- Extract the zip file and navigate to the directory 'fake-news-detection-main'
- Open command prompt in the extracted directory 'fake-news-detection' and run the command 'jupyter notebook'
For other Operating System,
- Click here to install python
- Click here to download the repository
- Extract the zip file and navigate to the directory 'fakenews-detection-main'
- Open terminal in the extracted directory 'fakenews-detection-main'
- Install dependencies by executing the command 'pip install -r requirements.txt'
- Run the command ‘jupyter notebook’ and select the notebook ‘FakeNewsdetection-starter.ipynb’ on the browser window. Instructions to Run
Follow the below instructions to run the solution.
- Locate and open the FakeNewsDetection-starter.ipynb notebook from the Jupyter Notebook browser window.
- Execute cells in the notebook by selecting Cell --> Run All from Menu bar
- Once all the cells of the notebook are executed, the prediction result will be written to the file 'fake_news_test_output.csv'
Training with your dataset:
- Add news articles to a csv file under a column name 'news_text'.
- Add corresponding labels as 'real' or 'fake' denoting whether a news article is real or not.
- You can refer to the file 'fake_news_train.csv' for an example.
- Set the variable for training file in the notebook under Variables section.
Testing with your dataset:
- Add news articles to a csv file under a column name 'news_text'.
- You can refer to the file 'fake_news_test.csv' for an example.
- Set the variable for testing file in the notebook under Variables section.
You can execute the cells of notebook by selecting Cell from the menu bar.