Skip to content

Diksha-cmd/Question-Answering_App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About Web App

This web application has been designed to hep users fetch answers to questions using numnerous NLP models . Users willl be able to view the list of available models , add new models , delete existing models , ask a question and upload a CSV with bulk questions. This application is made using streamlit library and it calls a flask api to make requests and fetch responses. Backend is esentially Postgresql in cloud database. Refer below architecture for more details

Web App URL

https://webapp-sueoei3pla-uc.a.run.app (Since the web app was delpoyed using Google cloud and the account is currently de-activated hence it is not working as of now, but users can read below description and screenshots to rebuild it)

How to use this web app

To use this app : Click on the above URL

System Architecture

image

You should be able to see below layout :

Get Models

Returns the list of existing models in the system
image

Put models

Let's you add a new model and will return a list of existing models
image

Delete models

Let's you delete an existing model and will return the list of remaining models
image

Question/Answer

Use this to post your questions along with context . You may select a model as well
image

Upload Questions

Use this to bulk upload your questions using a CSV
image

Sample CSV
image

Prerequisites and Installation (Dependencies)

To run this web application, you'll need the following pre-requisites installed on your machine

Library Version Installation
Python 3.9.1 or above Python
Streamlit 0.82.0 pip install streamlit
Docker Engine NA Docker
Pandas NA pip install pandas

You need to install all the dependencies available in requirements.txt

Steps to build and run the app locally via Docker

There are two ways to deploy the Web App on your local machine:
1. Deployment with Streamlit:

      1. To deploy the app on your local machine through Streamlit, we just need to run the python file using command streamlit run App.py(which is the name of python file having code for the application)

>>> streamlit run webapp.py

      2. This will deploy your webapp on your local machine. Post successful deployment of the code

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501
Network URL: http://10.0.0.244:8501

      3. You can access the web app through chrome, edge or any web browser and start sending requests to the REST API through the portal.

2. Deployment through Docker:

  • To deploy the app on your local machine through docker, we need a docker file ,given we already have the application file created, that would be the recipe for docker to build the application
  • In the dockerfile, we will add the required dependency of python:3.7-slim
  • Once the dockerfile is created, we'll execute the deployment of the docker container which would be published and deployed
  • We'll copy the webapp.py in the app folder and the application would run once the docker image was deployed

Sample Dockerfile

FROM python:3.7-slim

EXPOSE 8080
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./

RUN pip install requests streamlit

CMD ["streamlit", "run", "--server.port", "8080", "--server.enableCORS", "false", "webapp.py"]

Building the Docker Image in the Active Directory/Folder

sudo docker build -t <image-name> .

Running the Docker Image - with ports defined for communication between local machine and docker image

sudo docker run -it -p 8501:8501 <image-name> /app/<aap-name>.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published