Skip to content

AbhinavDShetty/Hack-Babies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 

Repository files navigation

Hack-Babies

Welcome to the LegalLens project! This repository provides a robust search system for querying laws and articles from the Indian Constitution. Leveraging semantic search and keyword-based search, LegalLens ensures users can find relevant legal texts effectively and intuitively.

Table of Contents

Features

  • Semantic Search: Find articles using natural language queries. For example, search for "freedom of speech laws" and get relevant results.
  • Keyword Search: Locate laws using specific terms or phrases.
  • Indian Constitution Focus: Exclusively designed to work with the Indian Constitution for targeted and accurate results.
  • Efficient Retrieval: Combines the power of embeddings and keyword matching for a fast and relevant search experience.

Prerequisites

Before you begin, ensure you have met the following requirements:

1. Python 3.11.9
2. A text editor (e.g., VS Code)
3. Git

Installation

Step 1: Clone the repository

git clone https://github.com/AbhinavDShetty/Hack-Babies.git

Step 2: Navigate to project directory

cd Hack-Babies\myproject

Step 3: Install VirtualEnvWrapper

pip install virtualenvwrapper-win

Step 4: Create a Virtual Enviroment

mkvirtualenv myvenv -p python3.11

Step 5: Activate the Virtual Enviroment

workon myvenv

Step 6: Install dependencies

pip install -r requirements.txt

Step 7: Run the run_me.py

python run_me.py

Step 8: Run the Server

python manage.py runserver
  • To stop the server, just press Ctrl+C.
  • Note: To deactivate the Virtual Enviroment
deactivate

Usage

  1. Start the website by running python manage.py runserver.
  2. Access the interface through the provided URL (e.g., http://127.0.0.1:8000).
  3. Use the search bar to:
  • Enter natural language queries for semantic search.
  • Enter specific terms for keyword-based search.
  1. Review the results, which will list relevant laws or articles from the Indian Constitution.

Flowchart

Flowchart

Project Structure

Hack-Babies/
	├──myproject/
	│	├──dump files
	│	├──myapp/
	│	│	├──hybrid_search.py		# Pre-trained model for semantic search
	│	│	├──urls.py
	│	│	└──views.py
	│	├──myproject/
	│	│	├──settings.py
	│	│	└──urls.py
	│	├──static
	│	├──templates/
	│	│	├──index.html
	│	│	└──search.html
	│	├──db.sqlite3
	│	├──final_database_v1.json		# The database of laws and articles
	│	├──Flowchart.png
	│	├──manage.py
	│	├── requirements.txt			# Dependencies
	│	└──run_me.py
	├──.gitattributes              
	└── README.md  

Technologies Used

  • Programming Language: Python
  • Libraries:
    • django - For building the web interface
    • json - For data manipulation
    • sentence-transformers - For semantic model development
    • scikit-learn - For semantic search using cosine_similarity
    • nltk - For keyword search using nltk.corpus
  • Search Techniques:
    • Scored keyword-based search
    • Embedding-based semantic search

Feel free to reach out with feedback or suggestions. Let's make legal information accessible for everyone!

Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors