Jupyter Notebook
0
16 commits
updated Aug 25, 2025
This project implements a Contract Document Classification system using both traditional Machine Learning (SVM) and Deep Learning (BERT) approaches. The system can automatically classify different types of contract documents based on their content.
The project consists of two main implementations:
Each implementation has its own web application interface built with Streamlit and FastAPI.
├── app/
│ ├── bert_app/ # BERT implementation frontend and backend
│ └── svm_app/ # SVM implementation frontend and backend
├── data/ # Training and validation datasets
├── models/ # Trained model files
└── notebooks/ # Jupyter notebooks for model development
The project uses two types of models:
models/ directoryClone the repository:
git clone https://github.com/Amoako419/Contract_Document_Classification.git
cd Contract_Document_Classification
Set up a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
Install required packages:
pip install -r requirements.txt
Start the FastAPI backend:
cd app/svm_app
uvicorn backend:app --reload
Then in a new terminal, launch the Streamlit frontend:
cd app/svm_app
streamlit run app.py
The BERT model is hosted on Hugging Face Hub at amoako419/legal-bert-contract-classifier for easy access and deployment.
Start the FastAPI backend:
cd app/bert_app
uvicorn backend:app --reload
Then in a new terminal, launch the Streamlit frontend:
cd app/bert_app
streamlit run app.py
The backend will automatically download the model from Hugging Face Hub on first use. The application will be available at:
Available in the notebooks/ directory:
contract_classification_ml.ipynb: SVM model trainingcontract_classification_bert.ipynb: BERT model trainingdata_preview.ipynb: Data exploration and preprocessingThe project uses the Contract Understanding Atticus Dataset (CUAD) for training and validation. The processed data is available in the data/ directory.
@article{hendrycks2021cuad,
title={CUAD: An Expert-Annotated NLP Dataset for Legal Contract Review},
author={Dan Hendrycks and Collin Burns and Anya Chen and Spencer Ball},
journal={NeurIPS},
year={2021}
}
This project is licensed under the terms of the LICENSE file included in the repository.
Jupyter Notebook
0
16 commits
updated Aug 25, 2025
This project implements a Contract Document Classification system using both traditional Machine Learning (SVM) and Deep Learning (BERT) approaches. The system can automatically classify different types of contract documents based on their content.
The project consists of two main implementations:
Each implementation has its own web application interface built with Streamlit and FastAPI.
├── app/
│ ├── bert_app/ # BERT implementation frontend and backend
│ └── svm_app/ # SVM implementation frontend and backend
├── data/ # Training and validation datasets
├── models/ # Trained model files
└── notebooks/ # Jupyter notebooks for model development
The project uses two types of models:
models/ directoryClone the repository:
git clone https://github.com/Amoako419/Contract_Document_Classification.git
cd Contract_Document_Classification
Set up a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
Install required packages:
pip install -r requirements.txt
Start the FastAPI backend:
cd app/svm_app
uvicorn backend:app --reload
Then in a new terminal, launch the Streamlit frontend:
cd app/svm_app
streamlit run app.py
The BERT model is hosted on Hugging Face Hub at amoako419/legal-bert-contract-classifier for easy access and deployment.
Start the FastAPI backend:
cd app/bert_app
uvicorn backend:app --reload
Then in a new terminal, launch the Streamlit frontend:
cd app/bert_app
streamlit run app.py
The backend will automatically download the model from Hugging Face Hub on first use. The application will be available at:
Available in the notebooks/ directory:
contract_classification_ml.ipynb: SVM model trainingcontract_classification_bert.ipynb: BERT model trainingdata_preview.ipynb: Data exploration and preprocessingThe project uses the Contract Understanding Atticus Dataset (CUAD) for training and validation. The processed data is available in the data/ directory.
@article{hendrycks2021cuad,
title={CUAD: An Expert-Annotated NLP Dataset for Legal Contract Review},
author={Dan Hendrycks and Collin Burns and Anya Chen and Spencer Ball},
journal={NeurIPS},
year={2021}
}
This project is licensed under the terms of the LICENSE file included in the repository.