How to use Azure Speech to text display text format features in Python?

LeetGPT 60 Reputation points
2024-04-10T02:07:05.78+00:00

Hi team, I am following this link for setting ITN, punctuation: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/display-text-format?pivots=programming-language-python

However I couldn't find any related code snippet or samples in Python for those configs? Could someone point me to the right documentation? Thank you so much!

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,407 questions
0 comments No comments
{count} votes

Accepted answer
  1. dupammi 6,810 Reputation points Microsoft Vendor
    2024-04-10T06:55:20.1633333+00:00

    Hi @LeetGPT

    Thank you for using the Microsoft Q&A forum.

    To use ITN as part of speech, you can pass the "format" query parameter with the value "detailed" to the Azure Speech to Text API. This will ensure that the API response contains all available text formats, including "Display", "ITN", "Lexical", and "MaskedITN".

    The inverse-text-normalized (ITN) or canonical form of the recognized text is printed with phone numbers, numbers, abbreviations (such as "doctor smith" to "dr smith"), and other transformations applied when using the "ITN" format.

    By default, the API response is in "Simple" format, which includes only the recognized text. However, you can use the "Detailed" format to obtain N-Best results in JSON format.

    By specifying the "Detailed" format query parameter, the API response will include all the available text formats, such as "Display", "ITN", "Lexical", and "MaskedITN". The "ITN" format will display numbers as numerical values instead of text. You can retrieve this response from the API and integrate it into your application.

    You can find a comprehensive list of all the supported query parameters for the Speech-to-text Rest API on this page and try to use these in your SDK as well.

    Thank you!

    I hope this helps.


    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.


0 additional answers

Sort by: Most helpful