CoolFace
Apppublic

talhafewfefefew/pakistani-law-rag

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
App README

๐Ÿง  RAG Legal Assistant - Pakistani Law

A Retrieval-Augmented Generation (RAG) system that provides AI-powered answers to questions about Pakistani law using a comprehensive legal document database.

๐Ÿš€ Features

  • โ€”Intelligent Legal Search: Uses semantic search to find relevant legal documents
  • โ€”AI-Powered Answers: Leverages GPT-3.5 to provide accurate, context-aware responses
  • โ€”Comprehensive Database: Built on a extensive collection of Pakistani legal documents
  • โ€”User-Friendly Interface: Simple Gradio interface for easy interaction

๐Ÿ”ง How It Works

  1. 1.Document Processing: Legal documents are cleaned and processed for optimal retrieval
  2. 2.Vector Embeddings: Documents are converted to embeddings using Sentence Transformers
  3. 3.Semantic Search: User questions are matched against the document database
  4. 4.AI Response: GPT-3.5 generates answers based on retrieved legal context

๐Ÿ“š Technology Stack

  • โ€”Frontend: Gradio
  • โ€”Vector Database: ChromaDB
  • โ€”Embeddings: Sentence Transformers (all-MiniLM-L6-v2)
  • โ€”LLM: OpenAI GPT-3.5-turbo
  • โ€”Backend: Python

๐ŸŽฏ Use Cases

  • โ€”Legal research and consultation
  • โ€”Understanding Pakistani law provisions
  • โ€”Quick legal reference lookup
  • โ€”Educational purposes for law students

โš ๏ธ Important Notes

  • โ€”Answers are based solely on the available legal documents in the database
  • โ€”This tool is for informational purposes only and should not replace professional legal advice
  • โ€”Always consult with qualified legal professionals for official legal matters

๐Ÿ”‘ Setup Requirements

To run this application, you need:

  • โ€”OpenAI API key (set as OPENAI_API_KEY environment variable)

๐Ÿ“ Example Questions

  • โ€”"What are the responsibilities of the Privatisation Commission?"
  • โ€”"What is the definition of privatization in Pakistan law?"
  • โ€”"What are the powers of the Armed Forces in emergency situations?"
  • โ€”"What are the provisions for study centres in Pakistan?"

๐Ÿค Contributing

Feel free to contribute to this project by:

  • โ€”Adding more legal documents to the database
  • โ€”Improving the search algorithms
  • โ€”Enhancing the user interface
  • โ€”Reporting bugs or suggesting features

๐Ÿ“„ License

This project is licensed under the MIT License.