This project trains an artificial neural network to classify voice search queries by intent—such as information
, command
, shopping
, or entertainment
. Built for clarity, modularity, and performance, the lab includes full GPU profiling using NVIDIA Nsight Systems and NVTX markers.
ml-training-lab/ ├── train_model.py # Training script with NVTX profiling ├── predict_intent.py # Inference script for new voice queries ├── utils.py # Shared preprocessing and encoding functions ├── assets/ # .png files for viewing ├── traces/ # Nsight Systems .nsys-rep files └── README.md # Project overview and instructions
- ✅ Real-world NLP pipeline using voice search data
- ✅ Intent classification with TensorFlow/Keras
- ✅ Modular design for training, inference, and preprocessing
- ✅ GPU profiling with Nsight Systems + NVTX annotations
- ✅ Interview-ready explanations of model behavior and performance
- Source:
voice_search_query_captures.csv
- Fields used:
query_text
: Input to the modelintent
: Target label
- Preprocessing:
- Lowercasing, punctuation removal
- Tokenization + padding
- Label encoding
Embedding
layer (vocab size: 1000, dim: 16)GlobalAveragePooling1D
Dense
(24 units, ReLU)Dense
(softmax output for multi-class classification)
Training is wrapped with NVTX markers for each epoch:
with nvtx.annotate("Epoch 1", color="blue"):
model.fit(...)
nsys profile -o traces/nn_training_trace --trace=cuda,nvtx python train_model.py
- CUDA kernel launches
- Memory transfers
- NVTX-labeled epochs
- CPU orchestration
python predict_intent.py
Query: 'Play jazz music on Spotify' → Predicted Intent: 'entertainment' Query: 'Turn off the living room lights' → Predicted Intent: 'command'
Explore the full training and testing workflow in the interactive notebook:
This notebook walks through:
- Data loading and preprocessing
- Model architecture and training
- NVTX-wrapped profiling setup
- Inference on new voice queries
- Commentary and visual outputs
- Python 3.8+
- TensorFlow
- scikit-learn
- NVIDIA Nsight Systems
- NVTX (pip install nvtx)
- Add confusion matrix and intent distribution visualizations
- Integrate real-time voice input via microphone
- Expand to multilingual intent classification
- Profile inference latency and memory footprint
Dartayous — Creative Technologist & AI/ML Engineer Focused on cinematic, modular GPU workflows and explainable AI. Built this lab to showcase real-world ML engineering and profiling mastery.
MIT License — feel free to fork, remix, and build upon it.