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.
- PDF text extraction using PDFPlumber
- Borrower identification
- Lender identification
- Financing amount extraction
- Jurisdiction detection
- Clause extraction
- Contract obligation detection
- Contract type distribution analysis
- Borrower analytics
- Financing amount analysis
- Clause frequency analysis
- Obligation frequency analysis
- Exploratory Data Analysis (EDA)
- Rule-based risk assessment
- Contract intelligence dashboard
- High-value contract identification
- Contract portfolio insights
- Clause classification engine
- Legal category mapping
- Contract summarization
- Contract type prediction using Machine Learning
- Upload contract PDFs
- Automated contract processing
- Real-time clause detection
- Risk score generation
- Contract summary generation
Contract PDF
β
PDF Text Extraction
β
Information Extraction
β
Structured Dataset Creation
β
Contract Analytics
β
Clause Classification
β
Contract Summarization
β
Risk Assessment
β
Machine Learning Classification
β
Streamlit Application
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
| 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 |
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 | Category |
|---|---|
| PURPOSE | General |
| TERM | General |
| PAYMENT | Financial |
| GUARANTEES | Security |
| INSURANCE | Compliance |
| DEFAULT | Risk |
| TERMINATION | Risk |
| JURISDICTION | Legal |
- Python
- Pandas
- NumPy
- PDFPlumber
- Matplotlib
- Scikit-Learn
- TF-IDF Vectorization
- Logistic Regression
- Streamlit
- Jupyter Notebook
Clone the repository:
git clone https://github.com/panicAtTheCompile/contract-intelligence.git
cd contract-intelligenceInstall dependencies:
pip install -r requirements.txtstreamlit run app/app.pyOpen your browser and upload a contract PDF to generate:
- Contract Summary
- Clause Detection
- Risk Assessment
- Contract Intelligence
- 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
- Named Entity Recognition using spaCy
- Transformer-based Legal NLP Models
- Hugging Face Integration
- LangChain Integration
- Retrieval-Augmented Generation (RAG)
- Conversational Contract Chatbot
- Cloud Deployment
Harshita Pulavarti Undergraduate at IIT Kharagpur | AI/ML Enthusiast | Data Science & NLP Projects
GitHub: https://github.com/panicAtTheCompile



