Lack_of_Facts
Introduction
By: Nisha Rajendran and Manmeet Gill
In this day and age, especially with the election coming up soon, we realize that news and media outlets have a powerful impact on the result of the election. During an election time, it is crucial that only factual articles are posted for the public to read. However, people do not always have the time to read an entire article and instead just use the headlines to obtain knowledge of a subject. According to a study by Colombia and the French National Institute, 59% of the general population only read the headlines and shared the link without reading the rest of the article. This could pose as a huge problem since if people are not careful, they could spread misinformation unknowingly. While we can’t change human behavior, we can assist them by giving them an easier way to decipher implicit bias behind article headlines without making them read the entire article. We have created a machine learning model to analyze an article’s title and output whether or not it is biased with a 95% accuracy rate.
How the program works:
We implemented a machine learning algorithm using Python libraries such as sci kit learn, numpy, pandas. Using these libraries we used the Naive Bayes classifier algorithm to create our program. In order to train our model, we procured a dataset from Kaggle(https://www.kaggle.com/clmentbisaillon/fake-and-real-news-dataset) where the data was split into two csv files. We used an app.py file as an external script for a website - made from scratch using HTML - and used Flask to link the two html files. The html program takes in input as an article name, and once ‘predict’ is clicked, the input is plugged into the machine learning algorithm, which predicts if the name is biased which is labeled as a 0 or if it is unbiased it is labeled as 1. After the machine learning algorithm makes its prediction, a second html file is created to display the correct output onto the screen using if-else statements. If the prediction outputs a 0, a headline stating that the article name was biased will be shown. If the prediction outputs a 1, then a headline saying that the article name is unbiased will be depicted on the screen. We added design elements to our html files as well to make it more appealing to the user. This included images, buttons, and text features. The main goal of this project is to give a way for people to take an article name, and without even reading its contents, determine whether that article is biased or unbiased. This resource is especially important now during election time, where voters need quick and efficient ways to make sure they are reading unbiased articles.
Instructions on running the code:
Download all the files that are in the github repository and make sure that they’re in their respective folders - The python file, the datasets, and a folder called templates should be within a folder called GTHACKS and the html files should be within the templates folder. You can download the datasets from google drive link provided below: https://drive.google.com/drive/folders/1pT-7Wa-93WIL6LgQAA68osd22tuoVTlI?usp=sharing After you download the files, run app.py in the GTHACKS folder in your terminal using the command $ python app.py
Log in or sign up for Devpost to join the conversation.