An AI-powered application to help users analyze, summarize, and interact with legal documents such as NDAs, contracts, employment letters, land leases, and rent agreements. Built using Cohere's LLM API and Streamlit for a quick, responsive, and interactive user experience.
- Document Upload: Upload PDF or DOCX legal documents for analysis.
- Initial Analysis: Automatically generates a detailed summary and analysis of the uploaded document.
- Conversational Chat Interface: Users can engage in a back-and-forth conversation with the app to clarify, explore, or ask questions about the document.
- Grounded Responses: All responses are grounded in the content of the uploaded document, ensuring accuracy and relevance.
- General Conversations: Handles conversations outside the document's scope while referencing the uploaded document for clarification when needed.
- User-Friendly Design: Simple and intuitive interface built with Streamlit, including loading indicators for better user experience.
.
├── main.py # Main application file
├── README.md # Project documentation
├── requirements.txt # List of dependencies
-
Clone this repository:
git clone https://github.com/your-username/legal-contract-analyzer.git cd legal-contract-analyzer
-
Install dependencies:
pip install -r requirements.txt
-
Run the app:
streamlit run main.py
-
Open your browser and navigate to:
http://localhost:8501
To use the app, you need a Cohere API Key:
- Sign up at Cohere and get your API key.
- Replace the placeholder in the script (
your-cohere-api-key
) with your actual API key.
- Upload a Document: Upload a PDF or DOCX legal document.
- Get an Initial Analysis: The app processes the document and provides a detailed summary.
- Start a Conversation: Use the chat interface to ask questions, clarify details, or discuss the document.
streamlit
: For building the web interface.cohere
: For natural language processing.PyPDF2
: For extracting text from PDF documents.python-docx
: For extracting text from DOCX files.
Install them using:
pip install -r requirements.txt
- Reviewing NDAs: Get a detailed analysis of non-disclosure agreements.
- Exploring Employment Contracts: Understand key clauses and terms.
- Analyzing Rent Agreements: Clarify rights, obligations, and legal terms.
Contributions are welcome! To contribute:
- Fork this repository.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes and push to your fork.
- Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Cohere: For the language model powering the app.
- Streamlit: For the rapid web app development framework.