# sutarshoeb/nlp-case-study-ca3 architecture

> Architecture diagram of the GitHub repository sutarshoeb/nlp-case-study-ca3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sutarshoeb/nlp-case-study-ca3
- Repository: https://github.com/sutarshoeb/nlp-case-study-ca3

## Overview

This repository is a notebook-based study comparing classical machine-learning classifiers with GPT fine-tuning for binary classification of research abstracts. Users supply datasets and run either notebook: the classical workflow vectorizes text and evaluates sklearn models, while the fine-tuning workflow prepares data and uses the OpenAI fine-tuning API. Both approaches are compared using test-set metrics. The README documents these capabilities; notebook internals were not sampled, so the graph shows only documented stages and avoids asserting finer-grained wiring.

Main entry points: [`notebooks/NLP_Fine_Tuning.ipynb`](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/NLP_Fine_Tuning.ipynb) (Fine-tuning workflow), [`notebooks/Traditional_ML_Implementation_Abstract.ipynb`](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb) (Classical workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_classical["Classical ML"]
  node_traditional_notebook["Classical workflow"]
  node_vectorizers["Count / TF-IDF"]
  node_classifiers["Sklearn classifiers"]
end

subgraph group_finetuning["GPT Fine-Tuning"]
  node_finetuning_notebook["Fine-tuning workflow"]
  node_gpt_model["GPT-4.1-nano"]
end

subgraph group_evaluation["Evaluation"]
  node_classical_metrics["Classical test metrics"]
  node_gpt_metrics["GPT test metrics"]
  node_comparison["Model comparison"]
end

node_user(("Notebook user"))
node_classical_csv["Classified abstracts CSV"]
node_split_csvs["Train/val/test CSVs"]
node_secrets["Colab API key"]
node_openai{{"OpenAI fine-tuning API"}}

node_user -->|"runs"| node_traditional_notebook
node_user -->|"runs"| node_finetuning_notebook
node_user -->|"uploads"| node_classical_csv
node_classical_csv -->|"provides data"| node_traditional_notebook
node_traditional_notebook -->|"vectorizes text"| node_vectorizers
node_traditional_notebook -->|"trains models"| node_classifiers
node_classifiers -->|"evaluates"| node_classical_metrics
node_classical_metrics -->|"contributes scores"| node_comparison
node_user -->|"uploads"| node_split_csvs
node_split_csvs -->|"provides data"| node_finetuning_notebook
node_user -->|"stores key"| node_secrets
node_secrets -->|"provides credential"| node_finetuning_notebook
node_finetuning_notebook -->|"uses fine-tuning API"| node_openai
node_openai -->|"fine-tunes"| node_gpt_model
node_finetuning_notebook -->|"evaluates test set"| node_gpt_metrics
node_gpt_metrics -->|"contributes scores"| node_comparison

click node_traditional_notebook "https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb"
click node_vectorizers "https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb"
click node_classifiers "https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb"
click node_finetuning_notebook "https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/NLP_Fine_Tuning.ipynb"
click node_gpt_model "https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/NLP_Fine_Tuning.ipynb"
click node_classical_metrics "https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb"
click node_gpt_metrics "https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/NLP_Fine_Tuning.ipynb"
click node_comparison "https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_traditional_notebook,node_vectorizers,node_classifiers,node_user toneBlue
class node_finetuning_notebook,node_gpt_model toneAmber
class node_classical_metrics,node_gpt_metrics,node_comparison,node_secrets,node_openai toneMint
class node_classical_csv,node_split_csvs toneIndigo
```

## Components

### Classical ML

- [Classical workflow](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb): `notebooks/Traditional_ML_Implementation_Abstract.ipynb`
- [Count / TF-IDF](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb): `notebooks/Traditional_ML_Implementation_Abstract.ipynb`
- [Sklearn classifiers](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb): `notebooks/Traditional_ML_Implementation_Abstract.ipynb`

### GPT Fine-Tuning

- [Fine-tuning workflow](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/NLP_Fine_Tuning.ipynb): `notebooks/NLP_Fine_Tuning.ipynb`
- [GPT-4.1-nano](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/NLP_Fine_Tuning.ipynb): `notebooks/NLP_Fine_Tuning.ipynb`

### Evaluation

- [Classical test metrics](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb): `notebooks/Traditional_ML_Implementation_Abstract.ipynb`
- [GPT test metrics](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/NLP_Fine_Tuning.ipynb): `notebooks/NLP_Fine_Tuning.ipynb`
- [Model comparison](https://github.com/sutarshoeb/nlp-case-study-ca3/blob/main/notebooks/Traditional_ML_Implementation_Abstract.ipynb): `notebooks/Traditional_ML_Implementation_Abstract.ipynb`

### Other components

- **Notebook user**
- **Classified abstracts CSV**
- **Train/val/test CSVs**
- **Colab API key**
- **OpenAI fine-tuning API**

## Connections

- Notebook user → Classical workflow: runs
- Notebook user → Fine-tuning workflow: runs
- Notebook user → Classified abstracts CSV: uploads
- Classified abstracts CSV → Classical workflow: provides data
- Classical workflow → Count / TF-IDF: vectorizes text
- Classical workflow → Sklearn classifiers: trains models
- Sklearn classifiers → Classical test metrics: evaluates
- Classical test metrics → Model comparison: contributes scores
- Notebook user → Train/val/test CSVs: uploads
- Train/val/test CSVs → Fine-tuning workflow: provides data
- Notebook user → Colab API key: stores key
- Colab API key → Fine-tuning workflow: provides credential
- Fine-tuning workflow → OpenAI fine-tuning API: uses fine-tuning API
- OpenAI fine-tuning API → GPT-4.1-nano: fine-tunes
- Fine-tuning workflow → GPT test metrics: evaluates test set
- GPT test metrics → Model comparison: contributes scores
