How vincent-stragier/llm-text-classifier works
This repository is a script-based LLM text-classification experiment. The main workflow downloads synthetic request datasets, splits them and renders model-specific prompts, then runs each prompt through a configured local LLM and stores class scores alongside ground truth. Model configurations and prompt templates parameterize preprocessing and inference; model weights can also be downloaded separately. The classifier evaluates candidate class-token continuations using logits, while shared utilities aggregate scores and map prompt paths to result paths. Edges follow the README workflow and shown calls; the dataset, model-config, and prompt-template contents were not sampled.
Main entry points: do_classification.py Classification runner · do_preprocess.py Prompt generation · download_datasets.py Dataset downloader · classifiers.py LLM classifier
Components 17
Data acquisition
- Synthetic datasets
- Dataset downloader
download_datasets.py
Prompt preparation
- Prompt generation
do_preprocess.py - Prompt templates
prompts - Generated prompts
prompts
Classification
- Classification runner
do_classification.py - LLM classifier
classifiers.py
Configuration and outputs
- Model configurations
models_configs - Model downloader
download_all_llms.py - LLM weights
- Score aggregation
utils.py - Classification results
results - Result path mapping
utils.py
Other components
- Experimenter
- Dataset host
- Hugging Face Hub
- llama.cpp runtime
Connections 22
- Experimenter → Dataset downloader: runs
- Dataset downloader → Dataset host: downloads from
download_datasets.py - Dataset downloader → Synthetic datasets: writes datasets
download_datasets.py - Experimenter → Prompt generation: runs
- Prompt generation → Synthetic datasets: loads and splits
do_preprocess.py - Prompt generation → Prompt templates: renders
do_preprocess.py - Prompt generation → Model configurations: loads
do_preprocess.py - Prompt generation → Generated prompts: writes prompts
do_preprocess.py - Experimenter → Model downloader: runs optionally
download_all_llms.py - Model downloader → Model configurations: loads
download_all_llms.py - Model downloader → Hugging Face Hub: downloads from
download_all_llms.py - Hugging Face Hub → LLM weights: provides weights
- Experimenter → Classification runner: runs
- Classification runner → Model configurations: loads
do_classification.py - Classification runner → Generated prompts: reads prompts
do_classification.py - Classification runner → Synthetic datasets: loads classes
do_classification.py - Classification runner → Hugging Face Hub: fetches model
do_classification.py - Classification runner → LLM classifier: calls classify
do_classification.py - LLM classifier → llama.cpp runtime: decodes tokens
classifiers.py - LLM classifier → Score aggregation: aggregates logits
classifiers.py - Classification runner → Result path mapping: maps result path
do_classification.py - Classification runner → Classification results: writes scores
do_classification.py