Using a custom model, you can boost accuracy for specific keywords and phrases that are important in your application.For example, lets say we are transcribing customer support phone calls and we want to more accurately recognize the following keywords/phrases:

"manager"
"cancel my account"
"close my account"
"overcharged"

Step 1: Create a custom model

Lets create a custom model that'll be more accurate at detecting these keywords/phases.

curl --request POST \
    --url 'https://api.assemblyai.com/model' \
    --header 'authorization: your-secret-api-token' \
    --data '
    {
      "phrases": ["manager", "cancel my account", "close my account", "overcharged"]
    }'

The response from the API will look like this:

{
   "model" : {
      "id" : 62584,
      "name" : "noted-donkey",
      "created" : "2018-06-06 22:05:01.783188",
      "warning" : "Phrase count low, adding phrases will improve accuracy",
      "status" : "training"
   }
}

Our custom model has an id of 62584, and a status of training. It takes about 10 minutes for a model to train. To check on the status, we can make a GET request:

curl --request GET \
    --url https://api.assemblyai.com/model/62584 \
    --header 'authorization: your-secret-api-token'
{
   "model" : {
      "id" : 62584,
      "status" : "training",
      "phrases" : [
         "manager",
         "cancel my account",
         "close my account",
         "overcharged"
      ],
      "warning" : "Phrase count low, adding phrases will improve accuracy",
      "created" : "2018-06-06 22:05:01.783188",
      "name" : "noted-donkey"
   }
}

We can see our model still has a status of training. We can make GET requests until the model has as status of trained.

Step 2: Using our custom model

Once our model has a status of trained, we can use it.

To transcribe an audio file with our custom model, we simply make an API call to /transcript and include our model's id in the model_id parameter like this:

curl --request POST \
    --url https://api.assemblyai.com/transcript \
    --header 'authorization: your-secret-api-token' \
    --data '
    {
      "audio_src_url": "http://www.foo.bar/file.mp3",
      "model_id": 62584
    }'