Watson Assistant CLI is a wrapper around the IBM Watson Speech-to-Text API that allows you to add custom vocabulary, grammar, and corpus as well train, test, and delete your models. The CLI allows you to perform these steps through a visual, interactive interface or directly through the command line.
python3 main.py --visual
The CLI prompts by asking you the URL and API key of your Speech-to-Text model. This information is found by clicking on your instance under Service tab after logging into your cloud account.
When using the visual mode, it saves the URL and API key, so for subsequent runs you can simply skip this step by pressing enter.
To interact directly with the CLI, don't pass the —visual flag. When interacting directly, you must pass the —url flag.
- Installation
- Visual Mode
- Training
- Evaluating
- See Available Models
- Delete
- Direct Mode
- Training
- Evaluating
- See Available Models
- Delete
- Clone the repository:
git clone https://github.ibm.com/pratyushsingh/watson_stt_custom_models_cli.git
- Create and activate virtualenv for the project to create an environment to install the dependencies:
python3 -m pip install --user virtualenv
python3 -m venv custom_watson_stt_cli
source env/bin/activate
- Install the dependencies:
pip install -r requirements.txt
The CLI prompts you with multiple options to train, evaluate, see existing trained models, and delete models. With the prompt, you can select multiple options, and the CLI will execute each one.
-
Training
- When training, the CLI prompts for the name of model, description of the model, and path of the corpus (or grammar, or out-of-vocabulary words). For the path, provide the full path of the training data.
- Once the information is provided, the CLI will upload the resources, create the model, and train it.
-
Evaluating aka Transcribing Audio Data
- With the evaluate option chosen, the CLI prompts for the path of the audio file, and presents a list of models to choose to transcribe the audio. You can choose multiple models to transcribe the audio file.
- The models are presented in reverse chronological order from the date they were trained. In other words, your latest trained model appears first.
-
Seeing Trained Models
- The CLI will list your trained models in reverse chronological order.
-
Delete Models
- You can delete all of your models or select which ones you want to delete.
python main.py --url <URL> --name <NAME> --descr <DESCRIPTION> --oov_file_path <PATH_TO_TRAINING_DATA>
- Evaluate your latest trained model:
python main.py --url <URL> --audio_file <PATH_TO_AUDIO_FILE> --eval latest
- To evaluate other models, you must pass in their customization id. You can evaluate multiple models at once.
- Delete all models
python main.py --url <URL> --delete all
- Delete specific models
python main.py --url <URL> --delete <CUSTOMIZATION_IDS>
python main.py --url <URL> --visual