BharatLAW is a sophisticated legal advisory chatbot focused on providing detailed and contextually accurate responses about the Indian Penal Code. It utilizes a powerful combination of machine learning technologies to efficiently process and retrieve legal information.
- Document Ingestion: Automated processing of text documents to store legal information in a FAISS vector database.
- Real-Time Interaction: Real-time legal advice through a conversational interface built with Streamlit.
- Legal Prompt Templating: Structured prompt format ensuring clarity, detail, and legal accuracy in responses.
🚀Blast off to discovery! Our project is waiting for you BharatLAW. Explore it today and elevate your understanding!🌟
Functionality | Description |
---|---|
Document Loading | Loads text documents from a specified directory. |
Text Splitting | Splits documents into manageable chunks for processing. |
Embedding Generation | Utilizes HuggingFace's InLegalBERT to generate text embeddings. |
FAISS Database | Indexes embeddings for fast and efficient retrieval. |
Feature | Description |
---|---|
Streamlit Interface | Provides a web interface for user interaction. |
Chat Functionality | Manages conversational flow and stores chat history. |
Legal Information Retrieval | Leverages FAISS index to fetch pertinent legal information based on queries. |
- Python 3.8 or later
- ray
- langchain
- streamlit
- faiss
- Clone the repository:
git clone https://github.com/your-repo/BharatLAW.git cd BharatLAW
- Install dependencies:
pip install -r requirements.txt
- Set up the Together AI API Key:
Obtain an API key from Together AI.
Sign up with Together AI today and get $25 worth of free credit! 🎉 Whether you choose to use it for a short-term project or opt for a long-term commitment, Together AI offers cost-effective solutions compared to the OpenAI API. 🚀
> To set this API key as an environment variable on any OS, you can use the following approach:
- On macOS and Linux:
echo "export TOGETHER_API_KEY='Your-API-Key-Here'" >> ~/.bash_profile source ~/.bash_profile
- On Windows (using Command Prompt):
setx TOGETHER_API_KEY "Your-API-Key-Here"
- On Windows (using PowerShell):
[Environment]::SetEnvironmentVariable("TOGETHER_API_KEY", "Your-API-Key-Here", "User")
This key is crucial for the chatbot to access language model functionalities provided by Together AI.
- Run the ingestion script to prepare the data:
python ingest.py
- Launch the Streamlit application:
streamlit run app.py
Navigate to the local URL provided by Streamlit to interact with the BharatLAW chatbot. Enter your legal queries and receive precise information derived from the indexed legal documents. Utilize the chat interface to engage in a legal discussion and get accurate advice.