Quest 03 / 03 · Quick build
Validate priority labels in a local ticket classifier
- Python
- Ollama
- classification evaluation
Why now A guide to local Ollama scripts shows how format checks can accept an unsupported interpretation, while a routing tutorial demonstrates validators on mock tickets. Build a small classifier that checks required output fields and priority values against the dataset schema before measuring its predictions.
Build it Write a Python script that sends a sample of synthetic support tickets to a locally running Ollama model and asks for a priority label. The script rejects malformed outputs and labels outside the dataset's known values, then reports accuracy on the accepted predictions; this sample does not represent a live helpdesk.
From the news
Tools
- Ollama
Ollama's runtime uses the MIT license, while model weights have their own licenses. Local execution has no Ollama usage charge; optional cloud inference uses metered credits, subscriptions and enterprise terms.
Data
- IT Support Tickets Kaggle
Sample synthetic ticket text and priority labels for a local classification and output-validation exercise.
Steps
- Load the dataset, inspect its columns, and identify the free-text ticket field and priority label field.
- Sample 100 rows and ask a locally available Ollama model to return a priority prediction in a fixed JSON shape.
- Reject outputs that omit a required field, fail JSON parsing, or use a priority value outside the dataset's known labels.
- Compare accepted predictions with the dataset labels and print accuracy plus accepted and rejected counts.
Done when
- The script runs on 100 sampled rows with local inference and prints accepted and rejected counts.
- It reports accuracy for accepted predictions against the dataset priority labels.
- A test output with a missing field or an unknown priority label is rejected.
