Legal Document Summarizer is a project that uses Flask, Docker, Helm, and Google Generative AI to extract legal concepts and generate summaries from uploaded legal documents in PDF format. The project consists of a Flask backend that communicates with Google Generative AI, a Dockerized application for easy deployment, and a Streamlit frontend for user interaction.
- Flask: A lightweight web framework used to create the backend API.
- Docker: Containerization technology to package the application and its dependencies.
- Helm: A Kubernetes package manager used to define, install, and manage Kubernetes applications.
- Google Generative AI: A high-level API client library and tools for leveraging Google's Generative AI models.
The backend is a Flask application that exposes two endpoints:
- /upload (POST): Accepts PDF files, extracts text, generates a response using Google Generative AI, and provides legal concepts and summaries.
- /get_summary/<document_id> (GET): Retrieves additional details or summaries based on the document ID.
The frontend is a Streamlit application that allows users to upload PDF files and view the generated legal concepts and summaries.
- Developed a Flask application with routes for file upload and summary retrieval.
- Integrated Google Generative AI for content generation.
- Created a Dockerfile to package the Flask application into a Docker image.
- Built and tagged the Docker image.
- Created a Helm chart with the following components:
- Chart.yaml: Metadata about the Helm chart.
- values.yaml: Default values for the Flask app.
- templates/deployment.yaml: Kubernetes Deployment configuration.
- templates/service.yaml: Kubernetes Service configuration.
- Packaged the Helm chart using
helm package .
. - Installed the Helm chart on a Kubernetes cluster using
helm install
.
- Developed a Streamlit app for user interaction with the Flask backend.
- Implemented file upload functionality and displayed legal concepts and summaries.
- Upload a legal document in PDF format using the Streamlit frontend.
- View the generated legal concepts and summaries.
- Optionally, request more details or summaries based on the document ID.
The Legal Document Summarizer project successfully combines Flask, Docker, Helm, and Google Generative AI to provide a streamlined solution for extracting legal concepts and generating summaries from legal documents.