Legal-Fillings is an AI-powered web application designed to simplify the process of filling out legal documents and application forms. This project aims to assist users in quickly and accurately completing various legal forms without the hassle of manual data entry. With built-in AI assistance, users only need to provide their basic details, and the system will automatically generate a well-structured, professional document.
- Preloaded Legal Documents: The application includes several commonly used legal documents and forms by default.
- AI-Powered Form Filling: Utilizes Google AI Studio to intelligently populate documents based on user input.
- Custom Document Addition: Users can add new legal documents as needed.
- PDF Generation: Automatically generates a filled PDF version of the document.
- Secure API Key Management: Uses an API key stored in a local file for secure AI access.
Form-Filler comes with the following default legal documents:
✔️ Affidavit (Rawalpindi)
✔️ Application for Certificate of Domicile
✔️ Application for Copy of Domicile Certificate
✔️ Application for Permission to Build
✔️ Application for Wood Transit Permit
✔️ Assets Form
✔️ Certificate of Domicile
✔️ Police Character Certificate
✔️ Undertaking for Construction
All these documents are stored in the documents/ folder.
git clone https://github.com/AS-0167/legal-fillings.git
cd legal-fillingsMake sure Docker is installed on your machine. Follow the installation guide for your operating system from the official Docker website:
Install Docker
To quickly set up and run the application in a Docker container, use the following commands:
-
Build the Docker image:
docker build -t form-filling-app . -
Run the Docker container:
docker run -d -p 8501:8501 form-filling-app
-
Run the app :
This will start the Form-Filler app in a Docker container, and you can access it by going to the follwing link in your web browser.
http://localhost:8501
If you prefer to run the app without Docker, ensure that you have Python installed. Then, install the required packages using:
pip install -r requirements.txtForm-Filler uses Google AI Studio for AI-driven form filling. To set up:
- Go to Google AI Studio and generate an API key.
- Save the API key in a file named
api.keyin the project root directory.
If you want to add a new document to the system:
- Place the PDF file inside the
documents/folder. - Run the following script to convert and integrate the new document:
python load_pdfs_as_txt.pyThis will convert the newly added PDFs into text format so that the AI can process them.
- Using Docker: If you are using Docker, simply run the container as described above, and the app will be accessible at
http://localhost:8501. - Without Docker: If you're not using Docker, run the following command:
streamlit run app.pyThis will launch the Form-Filler web interface in your default browser.
- Select a Legal Document: Choose a document from the provided list.
- Enter Required Information: The app will prompt you for the necessary details.
- AI-Powered Form Completion: Google AI Studio fills in the document based on your input.
- Download the Completed PDF: The generated document is downloaded in the folder
documents_filled/.
We welcome contributions! Feel free to fork this repository, submit issues, or create pull requests to improve the project.