Skip to content

A Flask Application Utilizing Papermill To Execute NLP Model Which Acts As API Between NodeJS Web Application and NLP Model

Notifications You must be signed in to change notification settings

HammadMomin/Autometa-FlaskApp-NLP-Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autometa Flask App (NLP Model)

Below Are the Steps to Run This Application On your System

Step 1: To clone the repository, use the following command:

git clone https://github.com/HammadMomin/Autometa-FlaskApp-NLP-Model.git

Step 2: Firstly, From the Drive Link Given Below Download the Two Files "MODEL_APR_23" and "tokenizer_encoder.unknown" into the main Project Directory As shown Below. DRIVE LINK: https://drive.google.com/drive/folders/1mkPbn_6zuydKQJHpnqR1Rb-KEFyc0gKz?usp=sharing

folder_structure_flask

Step 3: Go to project directory folder and run this Command.

python -m venv venv

This Above Command will create a virtual environment named as "venv" in the Project Directory. This Command Will Not Work If You don't have Python in Your Machine. If Not then install it from https://www.python.org/downloads/ and Include this in your System Environment Variables Inside the Path. After This You are Good to run the above command for creating the virtual environment.

Step 4: To Activate your virtual environemnt i.e venv. Run the Following Command.

venv\Scripts\activate.bat

This Will Activate the Virtual And You Can See Something Like This On your Terminal.

venv terminal

Step 5: To Install All the Packages And Libraries Used In the Project. Run the Following Command. NOTE: Only Run this Command after Activating the virtual environment as Shown in above Step

pip install -r requirements.txt

Step 6: To run the Pyhton Script. Execute the Following Command.

python app.py

Now You Can See Your Flask Applicaton Is Running at Port http://127.0.0.1:5000.

Flask Terminal


  • After This Your Flask Application is Ready To take 2 Variables as "text" and "questions" from nodeJs application (https://github.com/HammadMomin/Autometa-Web-App.git) with the help of axios.post method And Serve it to the Jupyter Notebook i.e "QAS.ipynb" as a input varibales by using papermill library. After Execution it Gernerates Output Notebook i.e "QAS_outuput.ipynb" and output.txt

  • From the output.txt file we are extracting the output and send it back to nodeJS (To Display it to the Frontend Of the Web Application)

  • Below is Shown that when the axios.post request get hitted from nodeJS then it will Act as API and Execute the Notebook And Send the Output Back.

2023-04-21 23-52-04


If You May Have Any Queries, You Can Reach me Out At [email protected]

About

A Flask Application Utilizing Papermill To Execute NLP Model Which Acts As API Between NodeJS Web Application and NLP Model

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published