Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

A project where artificial intelligence is used to distinguish between fake and real information.

License

Notifications You must be signed in to change notification settings

StudentTraineeCenter/defacto-fakenews

Repository files navigation

Readme v češtině na tomto odkazu

Defacto - Fake news detection 👋

A project where artificial intelligence is used to distinguish between fake and real information. 📰

Getting started 🖥️

  1. Clone repo to your local machine with git clone and link from github
  2. Open directory and start install.bat file. This will install all necessary libraries and also will start a program And it is done. Your web server and python api is running.

How it works❓

Image In this simple diagram you can see how the whole program works. First, we receive URL on web server. We take this url and pass it to scrapePage.cjs. Function of this program is described deeper in this readme. Then, we send post request to python api containing scraped text as body. Python API gets this text and calls Ai model to decide truthfulness of text. When decision is made, we send it back to web server and it shows on frontend.

Python model ⛵

There is a python AI model, trained on a dataset from kaggle. It uses Sklearn and Pandas 🐼 library. We use function classify_text, which we then export to file server.py. In server we use flask library for own API. API takes text as body and returns true/false based on prediction about the news. Dataset used is from some Kaggle project. Accuracy of this Ai model is 0.92230, meaning it is trained and 92,23% same as data that we have provided.

Scraping with Javascript 🌥️

We used a javascript library called Pupeteer to fetch an h1 element from a given website, after doing so, the program returns the result and sends it over to our Python API that decides whether the information is according to reality or is but a fabrication.

Design language 🌍

We created a simple, yet stylish frontend for our application, adding a monochrome design to it.

Color Hex
Starry night #121212 #121212
Midnight #000000 #000000
Snowy white #ffffff #ffffff
Elephant tusk #CFCFCF #CFCFCF
Font Link
Consolas https://en.wikipedia.org/wiki/Consolas

URL Handling 🤦‍♂️

We added a simple solution, to check, whether the input is a valid url. togif