App Link: Text Summarizer App
Video Link: Youtube Link
This project showcases a text summarization application built using Flask and hosted on Azure App Services. It demonstrates an auto-scaling container approach, ideal for scalable web-hosted applications. The core functionality of this app is based on OpenAI's GPT-3.5 model, which is adept at summarizing texts efficiently. This application is a practical application of Flask and GPT-3.5 technology, aiming to provide concise and meaningful summaries of extensive texts.
The main script for our application is in main.py
, which orchestrates the interaction with the OpenAI API for text summarization. The Flask framework is used to handle web requests and render templates. The key Flask route /summarize
is designed to receive text and return its summarized version using GPT-3.5. For the web interface, idv4.html
is the primary template, located in the templates directory. This file outlines the UI and UX of our application.
- Environment Setup:
load_dotenv()
to load environment variables. - Flask App Initialization:
Flask(__name__)
. - OpenAI API Key Configuration: Set using
openai.api_key
. - Routes:
/
for the index route to render the main template./summarize
for processing text summarization requests.
The Dockerfile is structured as follows:
- Base Image:
python:3.11
- Working Directory:
/code
- Dependencies Installation:
pip3 install --no-cache-dir -r requirements.txt
- Copying Source Files
- Exposing Port:
50505
- Entry Point:
gunicorn
with configuration formain:app
The application is designed to be deployed as a container on Azure, utilizing Azure's capabilities for scalability and reliability.
To get started with the application:
- Clone the Repository: Clone this repo to your local machine.
- Install Dependencies: Use
make install
to install required packages. - API Key Setup: Acquire an OpenAI API key and save it to the
.env
file. - Local Testing: Run
main.py
locally to test its functionality. - Docker Image: Build the Docker image for deployment.
- Azure CLI: Login to the Azure CLI.
- Deploy on Azure: Deploy the application as an Azure web app.
- Usage: Access the application using the provided link to start summarizing texts.