Retraining rebuilds the neural network from scratch using the intents defined inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/diazdavilajesus16-stack/IA-LUMINA/llms.txt
Use this file to discover all available pages before exploring further.
respuestas.json. You need to retrain whenever you add new intents, edit existing patterns, or remove outdated entries — any change to the intent data requires a new model before Lumina AI can recognize it.
Prerequisites
Make sure the following Python packages are installed before running the training script:tensorflowandkeras— neural network architecture and trainingnltk— tokenization and lemmatizationnumpy— numerical array operations
Steps
Edit respuestas.json
Add or update intent objects in
respuestas.json. Each intent needs a tag, a list of patterns, and a list of responses. See the intents configuration guide for the full schema and examples.Watch the output
The script prints progress at each stage. You will see the vocabulary count, intent count, training sample count, and final accuracy percentage. If any stage fails, the error message will appear here.
What the script produces
Runningtraining_chatbot.py writes three files to the project root:
| File | Description |
|---|---|
chatbot_model.h5 | The trained Keras neural network weights and architecture |
words.pkl | Serialized vocabulary list used for bag-of-words vectorization |
classes.pkl | Serialized list of all intent tag names |
chatbot.py. All three must be present and consistent with each other — they are always regenerated together.
Training output example
A successful training run prints the following to the console:Training hyperparameters
The model is trained with the following fixed hyperparameters defined intraining_chatbot.py:
| Parameter | Value | Description |
|---|---|---|
epochs | 300 | Number of full passes through the training data |
batch_size | 8 | Samples processed per gradient update |
learning_rate | 0.005 | SGD optimizer step size (with Nesterov momentum 0.9) |