Code Monkey home page Code Monkey logo

legal-ease's Introduction

Legal-ease Logo

A suite of NLP tools to simplify legal documents

What do employment agreements, contracts, lease documents, patents and licenses have in common?

Apart from the fact that they're all legal documents:

  1. They tend to have complex sentence structure and vocabulary choices that aren't accessible to people only familiar with conversational English
  2. Are difficult to comprehend for non-native speakers of the language they are written in
  3. Can run into several tens of pages (if not more)

Legal-ease addresses these issues using three tools:

  1. QnA over legal documents: Copy your document and ask it questions. Useful whether you have questions about the document as a whole or a specific clause.

  2. Document summarization: Generate a summary of the document. Options include changing the length of the summary (small, medium or large) and a choice between paragraphs or bullets.

  3. Multi & Cross-lingual document search: Perform cross-lingual semantic search over a collection of legal documents. This is currently a showcase feature allowing the user to perform keyword as well as semantic search over a collection of COVID-19 pandemic legislative documents and returns the top-3 document matches. Also features the option to translate into other languages [currently English-only].

Installation:

  1. Create a free-tier Cohere account and set the COHERE_API_KEY environment variable.

  2. Create a free-tier Qdrant cluster and set the following environment variables - QDRANT_API_KEY AND QDRANT_HOST.

  3. Install requirements.

cd <project_dir>

conda create -n legal-ease --file requirements.txt

conda activate legal-ease

Usage

In the project dir, run:

python gradio_demo.py

To run the app in reload mode:

gradio gradio_demo.py

The app should typically appear on the url: http://localhost:7860

Legal-ease app

Tools & Technologies used:

  1. Cohere: Cohere offers capability to add cutting-edge language processing to any system. They train large language models with API access. Legal-ease uses Cohere's multilingual-22-12 model to obtain multilingual embeddings, the summarize-xlarge model for summarization and command-xlarge-nightly for question answering.

  2. Qdrant: Qdrant is a vector similarity engine & vector database and comes with an API service for semantic search - searching for the nearest high-dimensional vectors.

  3. Langchain: It is an open source library that provides abstractions for building LLM-based applications

  4. Gradio: The frontend of the application is built using Gradio.

  5. HF Spaces: Hugging Face Spaces offers deployment support for ML applications. Here is the link to our space

References:

Acknowledgements:

legal-ease's People

Contributors

shivalikasingh95 avatar pratikmehta14 avatar

Stargazers

Shruti Tambe avatar Sanjoy Kumar Biswas avatar Daggie Blanqx (Douglas Mwangi) avatar athulspal avatar Maniklem avatar Manikant Kella avatar  avatar Mohammed Sunasra avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.