Skip to content

Detecting Fake News with BERT and LSTMs. Developing a web app with Flask and HTML

Notifications You must be signed in to change notification settings

shayaf84/Fake-News-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Folders:

Models:

  1. Dense Layer Model - Gensim Doc2Vec Word Vectors
  2. LSTM Model - Word2Vec Vectors
  3. BERT Model

Templates:

  1. index.html - Front end of the model -> programmed with html and css
  2. sub.html - Redirect after submission

Files:

app.py - Back end programmed in Flask

One will need to download all the models in the Models folder for use in app.py. File sizes are large as SOTA models have larger parameters

Implementation

Download all folders and set up your environment (I used colab). Run all files in the "Models" folder and download the pickle file that denotes each of the models. From there, use this code to connect to an ngrok terminal:

!pip3 install tensorflow_text==2.7.0
!pip3 install flask-ngrok

! curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok   

! ngrok authtoken [PUBLIC KEY]

Ensure all the models, templates, and the app.py file are in the same directory.

Then, you can run the app.py file

Screen Shot 2022-02-07 at 10 45 57 PM

About

Detecting Fake News with BERT and LSTMs. Developing a web app with Flask and HTML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages