• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Crypto Currency
  • Technology
  • Contact
NEO Share

NEO Share

Sharing The Latest Tech News

  • Home
  • Artificial Intelligence
  • Machine Learning
  • Computers
  • Mobile
  • Crypto Currency

Create Your Own Speech-To-Text Custom Language Model

February 16, 2021 by systems

Create A Model

With IBM STT the whole process can be managed via CURL commands. There are other ways also to interface with the STT environment.

To create a language model with a customization id, run this curl command.

The apikey and url are displayed when you create the service in the IBM Cloud console.

curl -X POST -u "apikey:xxxxxxxxxxxxxxxxxxxxxxxxxx" 
--header "Content-Type: application/json"
--data "
{"name": "Mobile Networks",
"base_model_name": "en-US_BroadbandModel",
"description": "This is a custom language model for Mobile Networks"}"
"https://api.eu-gb.speech-to-text.watson.cloud.ibm.com/instances/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/v1/customizations"

The customization ID is returned. Save this value, as it will be used as a reference going forward.

{"customization_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"}

List Customization Models

If you have multiple models, you can list them and view the meta data.

curl -X GET -u "apikey:xxxxxxxxxxxxxxxxxxxxxxxxxx" "https://api.eu-gb.speech-to-text.watson.cloud.ibm.com/instances/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/v1/customizations"

With each model shown as:

The data listed with a model

Upload Corpus File

Make sure you are in the directory where your corpus text file is located, and run this command. The customization ID is added to the URL as the reference.

curl -X POST -u "apikey:xxxxxxxxxxxxxxxxxxxxxxxxxx" — data-binary @MobileNetworksCorpus.txt "https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/xxxxxxxxxxxxxxxxxxxxxxxx/corpora/mobile"

View The Status

Once the corpus file is uploaded, you can view the status of your upload:

curl -X GET -u "apikey:xxxxxxxxxxxxxxxxxxxxxxxxxx" "https://api.eu-gb.speech-to-text.watson.cloud.ibm.com/instances/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/v1/customizations/xxxxxxxxxxxxxxxxxxxxxxxx/corpora/mobile"

Again the customization ID we gleaned earlier in the story is part of the URL, marked by x’s.

After running the command, you will see the following results on the left. This means the file contains 814 words out of this the model is not trained on 4 words. So once we send the model for training it will be trained on these 4 out of vocabulary words.

Training The Language Model

The language model can now be trained and the out-of-vocabulary words will be added.

curl -X POST -u "apikey:xxxxxxxxxxxxxxxxxxxxxxxxxx" "https://api.eu-gb.speech-to-text.watson.cloud.ibm.com/instances/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/v1/customizations/xxxxxxxxxxxxxxxxxxxxxxxx/train"

View Training Results

The training results can be viewed…

curl -X GET -u "apikey:xxxxxxxxxxxxxxxxxxxxxxxxxx" "https://api.eu-gb.speech-to-text.watson.cloud.ibm.com/instances/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/v1/customizations/xxxxxxxxxxxxxxxxxxxxxxxx/words?sort=%2Balphabetical"

And below you can see result from the training.

Adding Individual Words

A JSON file can be defined within the CURL command and data can be added to the language model in this way, without making use of a corpus file. With this option a word can be added, with tags for:

  • Sounds Like (multiple options can be added)
  • Display as
curl -X POST -u "apikey:xxxxxxxxxxxxxxxxxxxxxxxxxx" 
--header "Content-Type: application/json"
--data
"{"words":
[ {"word": "PUK",
"sounds_like":
[ "phuk", "puck", "pike"],
"display_as": "PUK"},
{"word": "iPhone",
"sounds_like": ["I. phone"]} ]}"
"https://api.eu-gb.speech-to-text.watson.cloud.ibm.com/instances/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/v1/customizations/xxxxxxxxxxxxxxxxxxxxxxxx/corpora/mobile"

Using the same command as previously used, the result can be viewed:

curl -X GET -u "apikey:xxxxxxxxxxxxxxxxxxxxxxxxxx" "https://api.eu-gb.speech-to-text.watson.cloud.ibm.com/instances/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/v1/customizations/xxxxxxxxxxxxxxxxxxxxxxxx/words?sort=%2Balphabetical"
JSON response after the update.

Filed Under: Artificial Intelligence

Primary Sidebar

Stay Ahead: The Latest Tech News and Innovations

Cryptocurrency Market Updates: What’s Happening Now

Emerging Trends in Artificial Intelligence: What to Watch For

Top Cloud Computing Services to Secure Your Data

The Future of Mobile Technology: Recent Advancements and Predictions

Footer

  • Privacy Policy
  • Terms and Conditions

Copyright © 2025 NEO Share

Terms and Conditions - Privacy Policy