使用語音轉換文字顯示文字格式設定
語音轉換文字提供格式化功能的數位,以確保轉譯的文字清晰易讀。 如需如何使用每項功能來改善最終文字輸出的整體清晰性,請參閱下列各節。
ITN
反向文字正規化 (ITN) 是將口語文字轉換成其書面形式的程式。 例如,口語 「four」 字會轉換成寫入格式 「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. |
拿掉不流暢
說話時,人們常會說出口語、重複字組,以及說“uhm” 或 “uh” 等填充字。 語音轉換文字可以辨識這類不多,並從顯示文字中移除它們。 不流暢的移除非常適合轉譯即時未標語的語音,以便稍後再閱讀。 下表顯示一些範例。
辨識的語音 | 顯示文字 |
---|---|
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 -
不雅內容篩選會套用至結果 Text
和 MaskedNormalizedForm
屬性。 不雅內容篩選不會套用至結果 LexicalForm
和 NormalizedForm
屬性。 這兩個篩選都不會套用至文字層級結果。