Aligner

VoiceBase allows you to align a human edited transcript with a previously run machine-generated transcript.

Examples

Note: Export your api token prior to running any of the following examples.

export TOKEN='Your Api Token'

Correcting a machine transcript and re-processing analytics and callbacks.

First, make a POST request to the /media resource.

curl -v -s https://apis.voicebase.com/v2-beta/media \
  --header "Authorization: Bearer ${TOKEN}" \
  --form media=@musicVoiceTone.wav \
  --form 'configuration={"configuration":{ "executor":"v2","transcripts":{"voiceFeatures":"true"}}}'

The response contains the mediaId you will use when aligning (e.g., 7eb7964b-d324-49cb-b5b5-76a29ea739e1, as below):

{
  "_links": {
    "self": {
      "href": "/v2-beta/media/7eb7964b-d324-49cb-b5b5-76a29ea739e1"
    }
  },
  "mediaId": "7eb7964b-d324-49cb-b5b5-76a29ea739e1",
  "status": "accepted",
  "metadata": {}
}

Export MEDIA_ID

export MEDIA_ID='7eb7964b-d324-49cb-b5b5-76a29ea739e1'

Make a request to the /media/$MEDIA_ID/transcripts/latest resource, including the Accept: text/plain header to retrieve the text transcript.

curl -v -s https://apis.voicebase.com/v2-beta/media/$MEDIA_ID/transcripts/latest \
  --header "Authorization: Bearer ${TOKEN}" --header "Accept: text/plain"
 

You may receive a 404 response indicating that the alignment of the new transcript with the original transcript and the recalculation of analytics and predictions is not complete.

{
    "status": 404,
    "warnings": {
        "message": "Transcripts only become available when a media item has status finished."},
    "reference":"e072fda3-d66e-48a6-9f9e-643937165e39"
}

When processing is complete on the media, you will receive the plain text transcript transcribed by Voicebase. Save it to an ascii text file named transcript.txt.

Old transcript in file.

You notice that the names are garbled, so you edit the plain text transcript in the file with your corrections.

New text transcript in file.

Now make a POST request to the /media/${MEDIA_ID} including a configuration and a transcript attachment.

curl -v -s https://apis.voicebase.com/v2-beta/media/$MEDIA_ID \
  --header "Authorization: Bearer ${TOKEN}" \
  --X POST \
  --form 'configuration={"configuration":{ "executor":"v2"}}' \
  --form transcript=@transcript.text

Finally, make a GET request on the /media/${MEDIA_ID} resource to download the latest analigned transcripts and configured analytics and predictions.

curl -v -s https://apis.voicebase.com/v2-beta/media/$MEDIA_ID \
  --header "Authorization: Bearer ${TOKEN}"

Note that the simple act of including a transcript with the POST triggers the alignment configuration.