Views
No views yet
bugfix, feature, chore, docs, refactor, etc.) using a hybrid ML pipeline: TF-IDF + metadata → SVM / RF / CatBoost.--gpu flag enables cuML / CatBoost GPU / XGBoost GPU automaticallyparser.py → GitHub API → commits.jsonl (resilient scraping)
build_dataset.py → commits.jsonl → dataset.jsonl (auto-label + feature extraction)
train.py → dataset.jsonl → model.joblib (train & save)
predict.py → model.joblib → label (inference CLI)
commitsorter.py → CommitClassifier class (library API)1# single prediction
2python predict.py "fix broad phase crash" 3 45 12
3
4# positional args: message [files_count] [additions] [deletions]
5python predict.py "bump lodash to 2.1"
6
7# batch via stdin
8echo '{"text":"fix crash","files_count":2}
9{"text":"add login page","files_count":5,"additions":200}' | python predict.py --stdin1from commitsorter import CommitClassifier
2
3clf = CommitClassifier("model.joblib")
4
5label, scores = clf.sort("fix renderer crash", files_count=2, additions=10)
6# → ("bugfix", [("bugfix", 0.77), ("chore", 0.11), ...])
7
8results = clf.sort_batch([
9 {"text": "update dependencies", "files_count": 1},
10 {"text": "add user auth", "files_count": 5, "additions": 200},
11])1# single model (default: SVM)
2python train.py svm
3python train.py lr
4python train.py rf
5python train.py cb
6python train.py xgb
7
8# tournament — compare all models
9python train.py --all
10
11# GPU acceleration (requires cuML / CUDA)
12python train.py svm --gpu
13python train.py --all --gpu| Field | Type | Description |
|---|---|---|
text | string | Commit message (prefix stripped) |
files_count | int | Number of files changed |
additions | int | Lines added |
deletions | int | Lines deleted |
changed_tests | int | Test files touched |
changed_docs | int | Doc files touched |
changed_source | int | Source files touched |
has_tests | bool | Any file in a test directory |
has_docs | bool | Any file in a docs directory |
extensions | [string] | Unique file extensions |
directories | [string] | Unique top-level directories |
label | string | Target class |
commit message ──→ TF-IDF(10k unigrams+bigrams)
file metadata ──→ StandardScaler
extensions ──→ OneHotEncoder
directories ──→ OneHotEncoder
↓
ColumnTransformer
↓
LinearSVC / RF / CatBoost / XGBoost| Label | Heuristics |
|---|---|
bugfix | fix:, :bug:, "crash", "prevent" |
feature | feat:, :sparkles:, "add", "implement" |
chore | chore:, "bump", "update", "lint" |
docs | docs:, file-only docs/, .md |
refactor | refactor:, "cleanup", "remove", "rename" |
test | test:, file-only spec/ or test/ |
build | build:, "upgrade", dependency changes |
ci | ci:, CI config changes |
perf | perf:, "optimize" |
style | style:, "format", "prettier" |
revert | revert: |
1# needs GITHUB_TOKEN in .env
2python parser.pycommits.jsonl. Resumes on interrupt via progress.json.