← Back to ML & GenAI

Dialogflow AutoTrainer

An automated MLOps pipeline built to execute continuous train-test-evaluate cycles on NLU models.

The Automated Lifecycle

Engineered a central orchestrator (main.py) that loops through isolated train.py, test.py, and evaluate.py modules. It continuously parses CSV datasets, trains the agent, tests utterances, and calculates accuracy until strict thresholds are met.

GCP & API Abstraction

Built a dedicated dfconnector.py layer to handle Google Cloud Service Account authentication and directly interface with the Dialogflow API, pushing intents and triggering remote training jobs without manual UI intervention.

Heuristic Evaluation

The pipeline doesn't just train; it validates. By systematically running test utterance files through the freshly trained model, the evaluation logic parses confidence scores and intent mappings to mathematically decide if another training epoch is required.

pipeline-execution.log
$ python main.py --cycle=auto --threshold=0.90
[10:14:02] [INFO] Loading training data from 5 CSV intent files...
[10:14:03] [INFO] Authenticating GCP Service Account via dfconnector.py... SUCCESS.
[10:14:05] [EXEC] Pushing intents to Dialogflow API...

[10:14:12] [EVAL] Epoch 1 completed.
[10:14:14] [WARN] Model accuracy at 72.4%. Threshold not met.
[10:14:14] [INFO] Initiating retraining cycle...

... training iterations omitted ...

[10:18:03] [EVAL] Epoch 4 completed.
[10:18:05] [SUCCESS] Model accuracy at 94.1%. Threshold achieved.
[10:18:06] [INFO] Pipeline execution terminated cleanly.