This repository contains code and models for the COMP34812 NLU coursework, focusing on evidence detection. The project implements various machine learning approaches including traditional approaches like SVM and XGBoost, and other transformer-based models like T5, RoBERTa and DeBERTa.
.
├── src/ # Source code directory
│ ├── augmentation/ # Data augmentation utilities
│ ├── experiments/ # Experimental model implementations
│ │ ├── xgboost/ # XGBoost experiments
│ │ ├── roberta/ # RoBERTa experiments
│ │ ├── deberta efl/ # DeBERTa with EFL experiments
│ │ └── T5/ # T5 experiments
│ ├── models/ # Production model implementations
│ │ ├── svm/ # SVM model implementation
│ │ └── deberta/ # DeBERTa model implementation
│ ├── notebooks/ # Jupyter notebooks for experiments
│ ├── utils/ # Utility functions and helpers
│ ├── config.py # Configuration settings
│ └── README.md # Source code documentation
├── data/ # Data directory
├── cache/ # Cache directory for GloVe embeddings
└── .venv/ # Python virtual environment
The code can be found in both the src/models folder, or you can view the notebooks in the src/notebooks folder.
You can find the trained versions of the models here.
The repository contains several model implementations:
- Location:
src/models/svm/ - A traditional machine learning approach using Support Vector Machines
- Includes feature extraction and model training utilities
- Location:
src/models/deberta/ - Implementation of the DeBERTa transformer model
- Includes both standard and EFL (Evidence-Focused Learning) variants
- Notebooks for training and evaluation in
src/notebooks/deberta/
- DeBERTa with EFL:
src/experiments/deberta efl - T5:
src/experiments/T5/ - XGBoost:
src/experiments/xgboost/ - RoBERTa:
src/experiments/roberta/
-
Environment Setup
Using UV
# Install UV if not already installed pip install uv # If your having troubles: ## Mac / Linux: curl -LsSf https://astral.sh/uv/install.sh | sh ## Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # Create virtual environment and install dependencies uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -r requirements.txt
-
Data Preparation
- Place your data files in the
data/directory
- Place your data files in the
-
Running Models
- For SVM: Use the scripts in
src/models/svm/python -m src.models.svm.main or uv run python -m src.models.svm
- For DeBERTa: Use the notebook in
src/notebooks/deberta/ - For data augmentation:
python -m src.augmentation.pipeline.main or uv run python -m src.augmentation.pipeline
- Each model directory contains specific instructions for training and evaluation
- For SVM: Use the scripts in
- The project uses Python 3.8+ and PyTorch for deep learning models
- Data augmentation utilities are available in
src/augmentation/ - Configuration settings can be found in
src/config.py - Cache directory is used for storing GloVe embeddings, speeding up training of the SVM model