Skip to content

panicAtTheCompile/contract-intelligence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“„ Contract Intelligence System

An end-to-end Legal NLP and Contract Analytics platform that transforms unstructured financing agreement PDFs into actionable business intelligence.

The system automatically extracts contract metadata, identifies legal clauses, generates contract summaries, performs risk assessment, classifies legal clauses, and provides an interactive Streamlit application for real-time contract analysis.


πŸš€ Features

Contract Extraction

  • PDF text extraction using PDFPlumber
  • Borrower identification
  • Lender identification
  • Financing amount extraction
  • Jurisdiction detection
  • Clause extraction
  • Contract obligation detection

Contract Analytics

  • Contract type distribution analysis
  • Borrower analytics
  • Financing amount analysis
  • Clause frequency analysis
  • Obligation frequency analysis
  • Exploratory Data Analysis (EDA)

Contract Intelligence

  • Rule-based risk assessment
  • Contract intelligence dashboard
  • High-value contract identification
  • Contract portfolio insights

Legal NLP

  • Clause classification engine
  • Legal category mapping
  • Contract summarization
  • Contract type prediction using Machine Learning

Streamlit Application

  • Upload contract PDFs
  • Automated contract processing
  • Real-time clause detection
  • Risk score generation
  • Contract summary generation

πŸ—οΈ System Architecture

System Architecture


πŸ–₯️ Application Demo

Streamlit Demo


πŸ“Š Analytics Dashboard

Analytics Dashboard


🚨 Risk Intelligence Dashboard

Risk Intelligence


πŸ”„ Project Workflow

Contract PDF
      ↓
PDF Text Extraction
      ↓
Information Extraction
      ↓
Structured Dataset Creation
      ↓
Contract Analytics
      ↓
Clause Classification
      ↓
Contract Summarization
      ↓
Risk Assessment
      ↓
Machine Learning Classification
      ↓
Streamlit Application

πŸ“ Project Structure

contract-intelligence/

β”œβ”€β”€ app/
β”‚   └── app.py
β”‚
β”œβ”€β”€ notebooks/
β”‚   β”œβ”€β”€ 01_dataset_exploration.ipynb
β”‚   β”œβ”€β”€ 02_contract_analytics.ipynb
β”‚   β”œβ”€β”€ 03_contract_intelligence.ipynb
β”‚   β”œβ”€β”€ 04_clause_classification.ipynb
β”‚   β”œβ”€β”€ 05_contract_summarization.ipynb
β”‚   └── 06_contract_type_prediction.ipynb
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ raw-contracts/
β”‚   └── processed/
β”‚
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ architecture_diagram.png
β”‚   β”œβ”€β”€ app_demo.png
β”‚   β”œβ”€β”€ analytics_dashboard.png
β”‚   └── intelligence_dashboard.png
β”‚
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── .gitignore

πŸ“š Project Modules

Notebook Description
01 Dataset Exploration Extract structured information from contract PDFs
02 Contract Analytics Perform exploratory analysis and visualization
03 Contract Intelligence Generate risk scores and contract intelligence
04 Clause Classification Categorize clauses into legal domains
05 Contract Summarization Generate automated contract summaries
06 Contract Type Prediction Train a machine learning classifier

🧠 Machine Learning Pipeline

The machine learning workflow includes:

  • Text Feature Engineering
  • TF-IDF Vectorization
  • Logistic Regression Classification
  • Cross Validation
  • Automated Contract Type Prediction

Due to the small synthetic dataset and highly standardized contract templates, the notebook serves as a proof-of-concept machine learning pipeline demonstrating legal document classification.


βš–οΈ Clause Categories

Clause Category
PURPOSE General
TERM General
PAYMENT Financial
GUARANTEES Security
INSURANCE Compliance
DEFAULT Risk
TERMINATION Risk
JURISDICTION Legal

πŸ› οΈ Tech Stack

Programming

  • Python

Data Processing

  • Pandas
  • NumPy

PDF Processing

  • PDFPlumber

Visualization

  • Matplotlib

Machine Learning

  • Scikit-Learn
  • TF-IDF Vectorization
  • Logistic Regression

Deployment

  • Streamlit

Development Environment

  • Jupyter Notebook

βš™οΈ Installation

Clone the repository:

git clone https://github.com/panicAtTheCompile/contract-intelligence.git
cd contract-intelligence

Install dependencies:

pip install -r requirements.txt

▢️ Run the Streamlit Application

streamlit run app/app.py

Open your browser and upload a contract PDF to generate:

  • Contract Summary
  • Clause Detection
  • Risk Assessment
  • Contract Intelligence

πŸ“ˆ Key Outcomes

  • Extracted structured information from 30+ financing agreements
  • Built a legal clause classification engine
  • Developed automated contract summarization workflows
  • Implemented contract risk assessment logic
  • Created a machine learning pipeline for contract classification
  • Deployed an interactive Streamlit application for contract intelligence

🎯 Future Improvements

  • Named Entity Recognition using spaCy
  • Transformer-based Legal NLP Models
  • Hugging Face Integration
  • LangChain Integration
  • Retrieval-Augmented Generation (RAG)
  • Conversational Contract Chatbot
  • Cloud Deployment

πŸ‘¨β€πŸ’» Author

Harshita Pulavarti Undergraduate at IIT Kharagpur | AI/ML Enthusiast | Data Science & NLP Projects

GitHub: https://github.com/panicAtTheCompile


About

Legal NLP and Contract Intelligence System for automated extraction, analytics, risk assessment, contract summarization, and contract classification from financing agreements.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors