Searching for a topic in a transcript

Wanted to see how many times a topic comes up in conversations. How would I do this with an API.
Looks like /api/v2/speechandtextanalytics/transcripts/search would do it but I do not know it is structured to find a topic. I guess it will look like below which is for sentiments.

{
"type": "RANGE",
"fields": [
"conversationSentimentScore"
],
"startValue": 0.1,
"endValue": 0.5
}

Hello,

I think the Analytics Transcript Aggregate query - POST /api/v2/analytics/transcripts/aggregates/query might be a more appropriate endpoint to achieve this.

I just tried it (I must confess for the first time, following your question....) and it might provide what you are looking for.
I assume that by "how many times a topic comes up in conversations" - you mean counting how many conversations included a specific topic (counting 1 per conversation even if the topic is repeated/detected several times in the conversation).

If yes, I used the following request body:

{
   "interval": "2021-07-07T22:00:00.000Z/2021-07-08T22:00:00.000Z",
   "groupBy": ["mediaType"],
   "metrics": ["nTopicCommunications"],
   "flattenMultivaluedDimensions": false,
    "filter": {
        "type": "and",
        "predicates": [
            {
                "dimension": "resultsBy",
                "value": "communication"
            },
            {
                "dimension": "topicId",
                "value": "THE_TOPICID_YOU_ARE_SEARCHING_FOR"
            }
        ]
    }
}

Regards,

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.