Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Argument

Type

Default

Description

--ontology_path

str

./data/ontology.json

Path to the ontology JSON file.

--train_data

str

./data/train.json

Path to the training dataset.

--test_data

str

./data/test.json

Path to the test dataset.

--model_save_path

str

checkpoints/model_checkpoint.pt

Path to save/load the trained model weights.

--train_model

bool

False

Train the model when this flag is set.

--evaluate

bool

False

Evaluate the model on the test dataset when this flag is set.

--num_epochs

int

2

Number of epochs for training.

--batch_size

int

16

Batch size for training.

--learning_rate

float

5e-5

Learning rate for the optimizer.

--max_length

int

16

Maximum sequence length for tokenization.

--seed

int

42

Random seed for reproducibility.

--inference_text

str

None

Text input for running inference.

--show_dist

bool

False

Show the intent and slot distribution in the dataset.

...

Use

21. Viewing Dataset Distribution

...

Code Block
python run_train_test.py --show_dist 

...

2. Training the Model

To train the model using the training dataset:

Code Block
python mainrun_train_test.py --train_model

...

3. Evaluating the Model

To evaluate a pre-trained model on the test dataset:

Code Block
python mainrun_train_test.py --evaluate 

...

4. Running Inference

To predict the intent and slots for a given input text:

Code Block
python mainrun_train_test.py --inference_text "Find me a Japanese recipe for lunch."

5. Run with ASR.

When complete with this section read https://socialrobotics.atlassian.net/wiki/spaces/PCA2/pages/2709488567/Run+your+Conversational+Agent#Run-your-Intent-and-Slot-Classifier-with-WHISPER to connect your intent and slot classifier with WHISPER