Folders:
Models:
- Dense Layer Model - Gensim Doc2Vec Word Vectors
- LSTM Model - Word2Vec Vectors
- BERT Model
Templates:
- index.html - Front end of the model -> programmed with html and css
- 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