你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

使用语音转文本显示文本格式

语音转文本提供一系列格式设置功能,确保转录的文本清晰易读。 有关每个功能如何用于提高最终文本输出的整体清晰度的概述,请参阅以下部分。

ITN

反文本规范化(ITN)是一个将口头形式转换为其相应的符号书面形式的过程。 例如,口语“四”转换为文字形式“4”。 语音转文本服务可完成此过程,且不可配置。 一些受支持的文本格式包括日期、时间、小数、货币、地址、电子邮件和电话号码。 你可以自然地说话,该服务会按预期设置文本格式。 下表显示了应用于文本输出的 ITN 规则。

识别的语音 显示文本
that will cost nine hundred dollars That will cost $900.
my phone number is one eight hundred, four five six, eight nine ten My phone number is 1-800-456-8910.
the time is six forty five p m The time is 6:45 PM.
I live on thirty five lexington avenue I live on 35 Lexington Ave.
the answer is six point five The answer is 6.5.
send it to support at help dot com Send it to support@help.com.

大写

语音转文本模型可识别应大写的单词,以提高可读性、准确性和语法水平。 例如,语音服务将在句子开头自动大写正确的名词和单词。 下表显示了几个示例。

识别的语音 显示文本
i got an x l t shirt I got an XL t-shirt.
my name is jennifer smith My name is Jennifer Smith.
i want to visit new york city I want to visit New York City.

删除间断语流

人们在说话时,常常会结巴、重复用词和使用“呃”或“嗯”等填充词。 语音转文本可以识别这种不流畅的语流并将其从显示文本中删除。 删除间断语流的功能非常适合转录现场即兴演讲,便于以后阅读。 下表显示了几个示例。

识别的语音 显示文本
i uh said that we can go to the uhmm movies I said that we can go to the movies.
its its not that big of uhm a deal It's not that big of a deal.
umm i think tomorrow should work I think tomorrow should work.

标点

语音转文本会自动为文本添加标点,让文本更加一目了然。 标点可提高通话或对话听录的可读性。 下表显示了几个示例。

识别的语音 显示文本
how are you How are you?
we can go to the mall park or beach We can go to the mall, park, or beach.

使用语音转文本进行连续识别时,可以将语音服务配置为识别显式标点符号。 然后,你可以大声说出标点符号,让文本更加易读。 此功能特别适用于需要使用复杂标点的情况,之后无需再进行合并。 下表显示了几个示例。

识别的语音 显示文本
they entered the room dot dot dot They entered the room...
i heart emoji you period I <3 you.
the options are apple forward slash banana forward slash orange period The options are apple/banana/orange.
are you sure question mark Are you sure?

如果使用语音转文本进行连续识别,请使用语音 SDK 启用听写模式。 此模式会促使语音配置实例解释对句子结构(如标点符号)进行的字面描述。

speechConfig.EnableDictation();
speechConfig->EnableDictation();
speechConfig.EnableDictation()
speechConfig.enableDictation();
speechConfig.enableDictation();
[self.speechConfig enableDictation];
self.speechConfig!.enableDictation()
speech_config.enable_dictation()

亵渎内容筛选器

可以指定是屏蔽、移除还是显示最终听录文本中的不当字词。 屏蔽功能会将字词替换为星号 (*) 字符,以便可以保留文本的原始情绪,同时使其更适合某些情况

注意

Microsoft 还保留屏蔽或删除被视为不恰当的任何单词的权利。 语音服务不会返回此类单词,无论是否启用了亵渎内容筛选器。

亵渎内容筛选器选项包括:

  • Masked:将不雅词语中的字母替换为星号 (*) 字符。 屏蔽是默认选项。
  • Raw:包括不雅词语原文。
  • Removed:删除不雅词语。

例如,若要从语音识别结果中删除不雅词语,请将亵渎内容筛选器设置为 Removed,如下所示:

speechConfig.SetProfanity(ProfanityOption.Removed);
speechConfig->SetProfanity(ProfanityOption::Removed);
speechConfig.SetProfanity(common.Removed)
speechConfig.setProfanity(ProfanityOption.Removed);
speechConfig.setProfanity(sdk.ProfanityOption.Removed);
[self.speechConfig setProfanityOptionTo:SPXSpeechConfigProfanityOption.SPXSpeechConfigProfanityOption_ProfanityRemoved];
self.speechConfig!.setProfanityOptionTo(SPXSpeechConfigProfanityOption_ProfanityRemoved)
speech_config.set_profanity(speechsdk.ProfanityOption.Removed)
spx recognize --file caption.this.mp4 --format any --profanity masked --output vtt file - --output srt file -

亵渎内容筛选器应用于结果 TextMaskedNormalizedForm 属性。 亵渎内容筛选器不应用于结果 LexicalFormNormalizedForm 属性。 该筛选器也不适用于单词级结果。