Get Phrase-by-Phrase Transcripts
// Overview
Leveraging the unique interactionIdentifier provided when successfully declaringsuccessfully declaring the audio interactionaudio interaction, the Phrase-by-Phrase Transcript endpoint lets you instantly retrieve a detailed phrase-by-phrase transcript for the audio file provided, including precise word timings, confidence scoresconfidence scores, and speaker labels.
When this GET successfully executes, an HTTP status is returned to indicate the request was successful, along with a JSON response providing your detailed transcription output.
{
"allParticipants": {
"phrases": [
"Thank", "You", "For", "Calling", ...
],
"phraseSegments": [
{
"startTimeOffset": 1410,
"endTimeOffset": 1730,
"phraseIndex": 0,
"score": 1
},
{
"startTimeOffset": 1730,
"endTimeOffset": 1810,
"phraseIndex": 1,
"score": 1
},
...]
...
}
...
}If an error occurs when requesting to declare the interaction, a standard HTTP status will be retuned to indicate the request was unsuccessful, along with a JSON response containing additional details to assist with troubleshooting.
// Request Parameters & Code Examples
import http.client
import json
conn = http.client.HTTPSConnection("api.elevateai.com")
payload = ''
headers = {
'X-API-Token': '{Your API Token}',
'Content-Type': 'application/json',
'Accept-Encoding': 'gzip, deflate, br'
}
conn.request("GET", "/v1/interactions/{interctionIdentifier}/transcript", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))// Response Schema
Schema
Element | Type | Description |
|---|---|---|
{participant} | object | Top level for speaker label,identifying whether data in object represents speech associated with allParticipants or participantOne and participantTwo |
{participant}/phrases | array of strings | Ordered list of each unique, non-redacted phase spoken by participant in the interaction |
{participant}/phraseSegments | array of objects | List of details associated with each utterance |
{participant}/phraseSegments/startTimeOffset | number | Start time of phrase, in milliseconds |
{participant}/phraseSegments/endTimeOffset | number | End time of phrase, in milliseconds |
{participant}/phraseSegments/phraseIndex | number | Index of phrase in participant/phrases |
{participant}/phraseSegments/score | float | Confidence score |
redactionSegments | array of objects | List of details associated with each redacted phrase |
redactionSegments/startTimeOffset | number | Start time of redacted phrase, in milliseconds |
redactionSegments/endTimeOffset | number | End time of redacted phrase, in milliseconds |
redactionSegments/result | string | Reason for redaction, will be CVV, Credit Card, or Social Security |
redactionSegments/score | float | Confidence score |
Need more help? Contact the ElevateAI Support team.