在本文中,您將學習如何在語音 SDK 中透過語音轉文字來評估使用者的語音發音。 發音評估能讓講者對語音的準確性與流暢度給予回饋。
註
發音評估使用特定版本的語音轉文字模型,與標準語音轉文字模型不同,以確保發音評估的一致性與準確性。
可用性與價格
作為基準,發音評量的使用成本與標準或定額層定價的語音轉換文字相同。 如果你購買語音轉文字的 承諾等級 ,發音評估的費用將用於達成承諾。 更多資訊請參閱定價。
串流模式與連續模式
發音評估支援不中斷的串流模式。 透過語音 SDK 可以無限時間錄製。 只要你不停止錄影,評估過程就不會結束,你可以方便地暫停並繼續評估。
關於如何在自己的應用程式中以串流模式使用發音評估,請參見 範例代碼。
關於如何在自己的應用程式中以串流模式使用發音評估,請參見 範例代碼。
關於如何在自己的應用程式中以串流模式使用發音評估,請參見 範例代碼。
關於如何在自己的應用程式中以串流模式使用發音評估,請參考 範例代碼,或嘗試 Azure Speech in Foundry Tools Toolkit。
關於如何在自己的應用程式中以串流模式使用發音評估,請參見 範例代碼。
關於如何在自己的應用程式中以串流模式使用發音評估,請參見 範例代碼。
關於如何在自己的應用程式中以串流模式使用發音評估,請參見 範例代碼。
如果你的音訊檔案超過 30 秒,請使用連續模式進行處理。 在連續模式下,則不支援這個 EnableMiscue 選項。 要取得 Omission 和 Insertion 標籤,你需要將已識別的結果與參考文字進行比較。 你可以在 GitHub 的函數 PronunciationAssessmentContinuousWithFile 中找到一個關於連續模式的範例實作。
如果你的音訊檔案超過 30 秒,請使用連續模式進行處理。 在連續模式下,則不支援這個 EnableMiscue 選項。 要取得 Omission 和 Insertion 標籤,你需要將已識別的結果與參考文字進行比較。
如果你的音訊檔案超過 30 秒,請使用連續模式進行處理。 在連續模式下,則不支援這個 EnableMiscue 選項。 要取得 Omission 和 Insertion 標籤,你需要將已識別的結果與參考文字進行比較。 你可以在 GitHub 的函數 pronunciationAssessmentContinuousWithFile 中找到一個關於連續模式的範例實作。
如果你的音訊檔案超過 30 秒,請使用連續模式進行處理。 在連續模式下,則不支援這個 EnableMiscue 選項。 要取得 Omission 和 Insertion 標籤,你需要將已識別的結果與參考文字進行比較。 你可以在 GitHub 的函式 pronunciation_assessment_continuous_from_file 找到連續模式的範例實作,或者試試 Azure Speech Toolkit。
如果你的音訊檔案超過 30 秒,請使用連續模式進行處理。 在連續模式下,則不支援這個 EnableMiscue 選項。 要取得 Omission 和 Insertion 標籤,你需要將已識別的結果與參考文字進行比較。 你可以在 GitHub 找到連續模式的範例實作。
如果你的音訊檔案超過 30 秒,請使用連續模式進行處理。 在連續模式下,則不支援這個 EnableMiscue 選項。 要取得 Omission 和 Insertion 標籤,你需要將已識別的結果與參考文字進行比較。 你可以在 GitHub 的函數 pronunciationAssessFromFile 中找到一個關於連續模式的範例實作。
如果你的音訊檔案超過 30 秒,請使用連續模式進行處理。 在連續模式下,則不支援這個 EnableMiscue 選項。 要取得 Omission 和 Insertion 標籤,你需要將已識別的結果與參考文字進行比較。 你可以在 GitHub 的函數 continuousPronunciationAssessment 中找到一個關於連續模式的範例實作。
如果你的音訊檔案超過 30 秒,請使用連續模式進行處理。 請注意,Go 的語音 SDK 不支援發音評估功能。 要啟用此功能,請為你的解決方案選擇不同的程式語言。
設定配置參數
註
Go 的語音 SDK 無法提供發音評估功能。 你可以閱讀本指南中的概念。 選擇另一種程式語言作為你的解決方案。
在 SpeechRecognizer中,你可以指定學習或練習發音改善的語言。 預設地點為 en-US。 要學習如何在自己的應用程式中指定發音評估的學習語言,您可以使用以下範例程式碼。
var recognizer = new SpeechRecognizer(speechConfig, "en-US", audioConfig);
auto recognizer = SpeechRecognizer::FromConfig(speechConfig, "en-US", audioConfig);
SpeechRecognizer recognizer = new SpeechRecognizer(speechConfig, "en-US", audioConfig);
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, language="en-US", audio_config=audio_config)
speechConfig.speechRecognitionLanguage = "en-US";
SPXSpeechRecognizer* recognizer = [[SPXSpeechRecognizer alloc] initWithSpeechConfiguration:speechConfig language:@"en-US" audioConfiguration:audioConfig];
let recognizer = try! SPXSpeechRecognizer(speechConfiguration: speechConfig, language: "en-US", audioConfiguration: audioConfig)
提示
如果你不確定該為有多個區域的語言設定哪個區域,可以分別嘗試每個區域。 例如,西班牙語時,嘗試 es-ES 和 es-MX。 判斷哪個地區在你的情境中得分較高。
你必須創造一個 PronunciationAssessmentConfig 物件。 你可以設定 EnableProsodyAssessment 啟用韻律評估。 欲了解更多資訊,請參閱 配置方法。
var pronunciationAssessmentConfig = new PronunciationAssessmentConfig(
referenceText: "",
gradingSystem: GradingSystem.HundredMark,
granularity: Granularity.Phoneme,
enableMiscue: false);
pronunciationAssessmentConfig.EnableProsodyAssessment();
auto pronunciationConfig = PronunciationAssessmentConfig::Create("", PronunciationAssessmentGradingSystem::HundredMark, PronunciationAssessmentGranularity::Phoneme, false);
pronunciationConfig->EnableProsodyAssessment();
PronunciationAssessmentConfig pronunciationConfig = new PronunciationAssessmentConfig("",
PronunciationAssessmentGradingSystem.HundredMark, PronunciationAssessmentGranularity.Phoneme, false);
pronunciationConfig.enableProsodyAssessment();
pronunciation_config = speechsdk.PronunciationAssessmentConfig(
reference_text="",
grading_system=speechsdk.PronunciationAssessmentGradingSystem.HundredMark,
granularity=speechsdk.PronunciationAssessmentGranularity.Phoneme,
enable_miscue=False)
pronunciation_config.enable_prosody_assessment()
var pronunciationAssessmentConfig = new sdk.PronunciationAssessmentConfig(
referenceText: "",
gradingSystem: sdk.PronunciationAssessmentGradingSystem.HundredMark,
granularity: sdk.PronunciationAssessmentGranularity.Phoneme,
enableMiscue: false);
pronunciationAssessmentConfig.enableProsodyAssessment();
SPXPronunciationAssessmentConfiguration *pronunicationConfig =
[[SPXPronunciationAssessmentConfiguration alloc] init:@"" gradingSystem:SPXPronunciationAssessmentGradingSystem_HundredMark granularity:SPXPronunciationAssessmentGranularity_Phoneme enableMiscue:false];
[pronunicationConfig enableProsodyAssessment];
let pronAssessmentConfig = try! SPXPronunciationAssessmentConfiguration("",
gradingSystem: .hundredMark,
granularity: .phoneme,
enableMiscue: false)
pronAssessmentConfig.enableProsodyAssessment()
此表列出了一些用於發音評估的關鍵配置參數。
| 參數 | 描述 |
|---|---|
ReferenceText |
用於評估發音的文本。 這個 ReferenceText 參數是可選的。 如果你想執行針對閱讀語言學習情境的 腳本評量 ,就設定參考文本。 如果你想做 非劇本評估,就不要設定參考文獻。關於劇本式與非劇本式評估的定價差異,請參見定價。 |
GradingSystem |
分數校準的積分系統。
FivePoint 給出浮點分數為0-5。
HundredMark 給出浮點數 0-100。 預設值: FivePoint。 |
Granularity |
決定最低層級的評估細微性。 傳回大於或等於最小值層級的分數。 可接受的數值包括 Phoneme,顯示全文、word、音節及音素層級的分數;Word,顯示全文及word層級的分數;或 FullText,僅顯示全文層級的分數。 所提供的完整參考文可以是一個字、一句話或一段。 這取決於你輸入的參考文本。 預設值: Phoneme。 |
EnableMiscue |
當發音詞彙與參考文本比較時,可進行誤差計算。 啟用誤讀是選擇性的。 若此值為 True, ErrorType 則可根據比較結果設定為 Omission 或 Insertion 。 值為 False 和 True。 預設值: False。 要啟用誤差計算,請將 設 EnableMiscue 為 True。 你可以參考表格上方的程式碼片段。 |
ScenarioId |
一個用於自訂點數系統的 GUID。 |
配置方法
這張表列出了一些你可以為 PronunciationAssessmentConfig 該物件設定的可選方法。
| 方法 | 描述 |
|---|---|
EnableProsodyAssessment |
啟用韻律評估以進行你的發音評估。 此功能會評估重音、語調、說話速度和節奏等面向。 此功能能讓你了解你說話的自然與表現力。 啟用韻律評估是選擇性的。 若呼叫此方法, ProsodyScore 則會回傳結果值。 |
取得發音評估結果
當語音被辨識時,你可以以 SDK 物件或 JSON 字串的方式請求發音評估結果。
using (var speechRecognizer = new SpeechRecognizer(
speechConfig,
audioConfig))
{
// (Optional) get the session ID
speechRecognizer.SessionStarted += (s, e) => {
Console.WriteLine($"SESSION ID: {e.SessionId}");
};
pronunciationAssessmentConfig.ApplyTo(speechRecognizer);
var speechRecognitionResult = await speechRecognizer.RecognizeOnceAsync();
// The pronunciation assessment result as a Speech SDK object
var pronunciationAssessmentResult =
PronunciationAssessmentResult.FromResult(speechRecognitionResult);
// The pronunciation assessment result as a JSON string
var pronunciationAssessmentResultJson = speechRecognitionResult.Properties.GetProperty(PropertyId.SpeechServiceResponse_JsonResult);
}
使用 Speech SDK for C++ 的 SDK 物件時,無法取得單字、音節和音素結果。 Word、音節和音素結果僅在 JSON 字串中提供。
auto speechRecognizer = SpeechRecognizer::FromConfig(
speechConfig,
audioConfig);
// (Optional) get the session ID
speechRecognizer->SessionStarted.Connect([](const SessionEventArgs& e) {
std::cout << "SESSION ID: " << e.SessionId << std::endl;
});
pronunciationAssessmentConfig->ApplyTo(speechRecognizer);
speechRecognitionResult = speechRecognizer->RecognizeOnceAsync().get();
// The pronunciation assessment result as a Speech SDK object
auto pronunciationAssessmentResult =
PronunciationAssessmentResult::FromResult(speechRecognitionResult);
// The pronunciation assessment result as a JSON string
auto pronunciationAssessmentResultJson = speechRecognitionResult->Properties.GetProperty(PropertyId::SpeechServiceResponse_JsonResult);
若想了解如何在自己的應用程式中指定發音評估的學習語言,請參閱 範例代碼。
在 Android 應用程式開發中,單字、音節和音素結果可透過 Java 語音 SDK 的 SDK 物件取得。 結果也以 JSON 字串形式提供。 在 Java 執行時(JRE)應用程式開發中,單字、音節和音素結果僅在 JSON 字串中提供。
SpeechRecognizer speechRecognizer = new SpeechRecognizer(
speechConfig,
audioConfig);
// (Optional) get the session ID
speechRecognizer.sessionStarted.addEventListener((s, e) -> {
System.out.println("SESSION ID: " + e.getSessionId());
});
pronunciationAssessmentConfig.applyTo(speechRecognizer);
Future<SpeechRecognitionResult> future = speechRecognizer.recognizeOnceAsync();
SpeechRecognitionResult speechRecognitionResult = future.get(30, TimeUnit.SECONDS);
// The pronunciation assessment result as a Speech SDK object
PronunciationAssessmentResult pronunciationAssessmentResult =
PronunciationAssessmentResult.fromResult(speechRecognitionResult);
// The pronunciation assessment result as a JSON string
String pronunciationAssessmentResultJson = speechRecognitionResult.getProperties().getProperty(PropertyId.SpeechServiceResponse_JsonResult);
recognizer.close();
speechConfig.close();
audioConfig.close();
pronunciationAssessmentConfig.close();
speechRecognitionResult.close();
var speechRecognizer = SpeechSDK.SpeechRecognizer.FromConfig(speechConfig, audioConfig);
// (Optional) get the session ID
speechRecognizer.sessionStarted = (s, e) => {
console.log(`SESSION ID: ${e.sessionId}`);
};
pronunciationAssessmentConfig.applyTo(speechRecognizer);
speechRecognizer.recognizeOnceAsync((speechRecognitionResult: SpeechSDK.SpeechRecognitionResult) => {
// The pronunciation assessment result as a Speech SDK object
var pronunciationAssessmentResult = SpeechSDK.PronunciationAssessmentResult.fromResult(speechRecognitionResult);
// The pronunciation assessment result as a JSON string
var pronunciationAssessmentResultJson = speechRecognitionResult.properties.getProperty(SpeechSDK.PropertyId.SpeechServiceResponse_JsonResult);
},
{});
若想了解如何在自己的應用程式中指定發音評估的學習語言,請參閱 範例代碼。
speech_recognizer = speechsdk.SpeechRecognizer(
speech_config=speech_config, \
audio_config=audio_config)
# (Optional) get the session ID
speech_recognizer.session_started.connect(lambda evt: print(f"SESSION ID: {evt.session_id}"))
pronunciation_assessment_config.apply_to(speech_recognizer)
speech_recognition_result = speech_recognizer.recognize_once()
# The pronunciation assessment result as a Speech SDK object
pronunciation_assessment_result = speechsdk.PronunciationAssessmentResult(speech_recognition_result)
# The pronunciation assessment result as a JSON string
pronunciation_assessment_result_json = speech_recognition_result.properties.get(speechsdk.PropertyId.SpeechServiceResponse_JsonResult)
若想了解如何在自己的應用程式中指定發音評估的學習語言,請參閱 範例代碼。
SPXSpeechRecognizer* speechRecognizer = \
[[SPXSpeechRecognizer alloc] initWithSpeechConfiguration:speechConfig
audioConfiguration:audioConfig];
// (Optional) get the session ID
[speechRecognizer addSessionStartedEventHandler: ^ (SPXRecognizer *sender, SPXSessionEventArgs *eventArgs) {
NSLog(@"SESSION ID: %@", eventArgs.sessionId);
}];
[pronunciationAssessmentConfig applyToRecognizer:speechRecognizer];
SPXSpeechRecognitionResult *speechRecognitionResult = [speechRecognizer recognizeOnce];
// The pronunciation assessment result as a Speech SDK object
SPXPronunciationAssessmentResult* pronunciationAssessmentResult = [[SPXPronunciationAssessmentResult alloc] init:speechRecognitionResult];
// The pronunciation assessment result as a JSON string
NSString* pronunciationAssessmentResultJson = [speechRecognitionResult.properties getPropertyByName:SPXSpeechServiceResponseJsonResult];
若想了解如何在自己的應用程式中指定發音評估的學習語言,請參閱 範例代碼。
let speechRecognizer = try! SPXSpeechRecognizer(speechConfiguration: speechConfig, audioConfiguration: audioConfig)
// (Optional) get the session ID
speechRecognizer.addSessionStartedEventHandler { (sender, evt) in
print("SESSION ID: \(evt.sessionId)")
try! pronConfig.apply(to: speechRecognizer)
let speechRecognitionResult = try? speechRecognizer.recognizeOnce()
// The pronunciation assessment result as a Speech SDK object
let pronunciationAssessmentResult = SPXPronunciationAssessmentResult(speechRecognitionResult!)
// The pronunciation assessment result as a JSON string
let pronunciationAssessmentResultJson = speechRecognitionResult!.properties?.getPropertyBy(SPXPropertyId.speechServiceResponseJsonResult)
結果參數
根據你使用的是 有劇本 還是 非有腳本 的評量,你可能會得到不同的發音評估結果。 腳本化評量是針對閱讀語言學習情境。 非腳本評量是針對口語學習情境。
註
關於劇本式與非劇本式評估的定價差異,請參見定價。
腳本化評量結果
此表列出了劇本化評量或閱讀情境中一些關鍵的發音評估結果。
| 參數 | 描述 | 粒度 |
|---|---|---|
AccuracyScore |
演講的發音準確度。 準確性表示音素與母語者的發音有多接近。 音節、單詞及全文準確度分數均從音素層級準確度分數彙整,並依評估目標進行精煉。 | 音素層級 音節層級(限於en-US) Word 層級, 全文層級 |
FluencyScore |
所給演講的流暢度。 流暢度表示該語言與母語者在詞間靜默段落的使用有多接近。 | 全文層級 |
CompletenessScore |
語音的完整度,由發音詞彙與輸入參考文本的比例計算。 | 全文層級 |
ProsodyScore |
演講韻律。 韻律表示指定語音的自然度,包括重音、語調、語速和節奏。 | 全文層級 |
PronScore |
該演講發音品質的總分。
PronScore根據AccuracyScore、FluencyScore、CompletenessScore和ProsodyScore計算,並賦予權重,但前提是ProsodyScore和CompletenessScore可用。 如果其中任何一個不可用,PronScore 就不會考慮那個分數。 |
全文層級 |
ErrorType |
此值表示錯誤類型與參考文本的比較。 選項包括單字是否遭到省略、插入,或以停頓方式不當插入。 它也會指出標點符號處是否缺少停頓。 它也會指出某個單字在語句中是否發音不佳,或以單調方式上升、下降或持平。 可能的值為 None,表示此單字沒有錯誤,以及 Omission、Insertion、Mispronunciation、UnexpectedBreak、MissingBreak 和 Monotone。 當某個單字的發音低於60時,錯誤類型可能是 Mispronunciation。 |
單字層級 |
非劇本評量結果
下表列出非劇本評估或口語情境中一些關鍵的發音評估結果。
註
韻律評估僅在 en-US 地區提供。 對於非腳本化評估,所使用的語音轉文字(STT)模型與 Azure STT 不同。 如果你需要基於高度精確且已識別的文字進行評估,我們建議先呼叫 Azure STT 取得參考文本,然後執行腳本化評估。
| 反應參數 | 描述 | 粒度 |
|---|---|---|
AccuracyScore |
演講的發音準確度。 準確性表示音素與母語者的發音有多接近。 音節、單詞及全文準確度分數均從音素層級準確度分數彙整,並依評估目標進行精煉。 | 音素層級 音節層級(限於en-US) Word 層級, 全文層級 |
FluencyScore |
所給演講的流暢度。 流暢度表示該語言與母語者在詞間靜默段落的使用有多接近。 | 全文層級 |
ProsodyScore |
演講韻律。 韻律表示指定語音的自然度,包括重音、語調、語速和節奏。 | 全文層級 |
PronScore |
該演講發音品質的總分。
PronScore是根據AccuracyScore、FluencyScore和ProsodyScore的權重計算出來的,前提是有ProsodyScore。 如果 ProsodyScore 沒有, PronScore 就不會考慮那個分數。 |
全文層級 |
ErrorType |
單字發音不佳、以停頓方式不當插入,或在標點符號處缺少停頓。 它也會指出發音在語句中是否以單調方式上升、下降或持平。 可能的值為 None(此字無誤差),Mispronunciation、UnexpectedBreak、MissingBreak 和 Monotone。 |
單字層級 |
下表更詳細描述韻律評估結果:
| 欄位 | 描述 |
|---|---|
ProsodyScore |
整句話的韻律評分。 |
Feedback |
對單字層級的反饋,包含 Break 和 Intonation。 |
Break |
|
ErrorTypes |
與中斷相關的錯誤類型,包括 UnexpectedBreak 和 MissingBreak。 目前版本沒有提供中斷錯誤類型。 您需要在 UnexpectedBreak – Confidence 和 MissingBreak – confidence 欄位上設定閾值,以決定單字前是否有非預期停頓或缺少停頓。 |
UnexpectedBreak |
表示單字前有非預期停頓。 |
MissingBreak |
表示單字前缺少一個空格。 |
Thresholds |
兩種信心分數的建議門檻均為0.75。 這表示如果 的 UnexpectedBreak – Confidence 值大於 0.75,則表示有意外的斷裂。 若 的 MissingBreak – confidence 值大於 0.75,則表示缺少一個中斷點。 雖然我們建議 0.75 是個數值,但最好根據你自己的情況調整閾值。 如果你想在這兩個中斷點有可變的偵測靈敏度,可以為 和 UnexpectedBreak - Confidence 欄位設定不同的閾值MissingBreak - Confidence。 |
Intonation |
用於指示語音中的語調。 |
ErrorTypes |
與語調相關的錯誤類型,目前僅支援單音調。 若 存在 Monotone 於場 ErrorTypes中,則該語句被偵測為單調。 系統會在整個語句上偵測到 Monotone,但會將標記指派給所有單字。 同一語句中的所有詞彙共享相同的單調偵測資訊。 |
Monotone |
表示語言單調。 |
Thresholds (Monotone Confidence) |
這些欄位 Monotone - SyllablePitchDeltaConfidence 保留給使用者自訂的單調偵測。 如果你對提供的單調決定不滿意,請調整這些欄位的閾值,根據你的偏好自訂偵測。 |
JSON 結果範例
以下範例中,口語詞「hello」的 腳本 化發音評估結果以 JSON 字串呈現。
- 音素字母表是 IPA。
- 同一詞的 音節 會與音素一同返回。
- 你可以使用
Offset和Duration值來對齊音節與其對應的音素。 例如,第二個音節loʊ的起始偏移量(11700000)與第三個音素l對齊。 位移代表已辨識語音在音訊串流中開始的時間。 該數值以100奈秒單位為單位測量。 欲了解更多與Offset和Duration相關的內容,請參閱反應特性。 - 有五個
NBestPhonemes對應於被要求的 語音音素 數量。 - 在
Phonemes內,最可能的 口語音素 是ə,而非所預期的音素ɛ。 預期音素ɛ的信心分數僅為47。 其他潛在配對的信心分數分別為52、17和2。
{
"Id": "bbb42ea51bdb46d19a1d685e635fe173",
"RecognitionStatus": 0,
"Offset": 7500000,
"Duration": 13800000,
"DisplayText": "Hello.",
"NBest": [
{
"Confidence": 0.975003,
"Lexical": "hello",
"ITN": "hello",
"MaskedITN": "hello",
"Display": "Hello.",
"PronunciationAssessment": {
"AccuracyScore": 100,
"FluencyScore": 100,
"CompletenessScore": 100,
"PronScore": 100
},
"Words": [
{
"Word": "hello",
"Offset": 7500000,
"Duration": 13800000,
"PronunciationAssessment": {
"AccuracyScore": 99.0,
"ErrorType": "None"
},
"Syllables": [
{
"Syllable": "hɛ",
"PronunciationAssessment": {
"AccuracyScore": 91.0
},
"Offset": 7500000,
"Duration": 4100000
},
{
"Syllable": "loʊ",
"PronunciationAssessment": {
"AccuracyScore": 100.0
},
"Offset": 11700000,
"Duration": 9600000
}
],
"Phonemes": [
{
"Phoneme": "h",
"PronunciationAssessment": {
"AccuracyScore": 98.0,
"NBestPhonemes": [
{
"Phoneme": "h",
"Score": 100.0
},
{
"Phoneme": "oʊ",
"Score": 52.0
},
{
"Phoneme": "ə",
"Score": 35.0
},
{
"Phoneme": "k",
"Score": 23.0
},
{
"Phoneme": "æ",
"Score": 20.0
}
]
},
"Offset": 7500000,
"Duration": 3500000
},
{
"Phoneme": "ɛ",
"PronunciationAssessment": {
"AccuracyScore": 47.0,
"NBestPhonemes": [
{
"Phoneme": "ə",
"Score": 100.0
},
{
"Phoneme": "l",
"Score": 52.0
},
{
"Phoneme": "ɛ",
"Score": 47.0
},
{
"Phoneme": "h",
"Score": 17.0
},
{
"Phoneme": "æ",
"Score": 2.0
}
]
},
"Offset": 11100000,
"Duration": 500000
},
{
"Phoneme": "l",
"PronunciationAssessment": {
"AccuracyScore": 100.0,
"NBestPhonemes": [
{
"Phoneme": "l",
"Score": 100.0
},
{
"Phoneme": "oʊ",
"Score": 46.0
},
{
"Phoneme": "ə",
"Score": 5.0
},
{
"Phoneme": "ɛ",
"Score": 3.0
},
{
"Phoneme": "u",
"Score": 1.0
}
]
},
"Offset": 11700000,
"Duration": 1100000
},
{
"Phoneme": "oʊ",
"PronunciationAssessment": {
"AccuracyScore": 100.0,
"NBestPhonemes": [
{
"Phoneme": "oʊ",
"Score": 100.0
},
{
"Phoneme": "d",
"Score": 29.0
},
{
"Phoneme": "t",
"Score": 24.0
},
{
"Phoneme": "n",
"Score": 22.0
},
{
"Phoneme": "l",
"Score": 18.0
}
]
},
"Offset": 12900000,
"Duration": 8400000
}
]
}
]
}
]
}
你可以取得以下的發音評估分數:
各地區支援的功能
下表總結了各地區支援的功能。 更多細節請參見以下章節。
| 音素字母表 | 國際音標 | SAPI |
|---|---|---|
| 音素名稱 | en-US |
en-US、zh-CN |
| 音節群 | en-US |
en-US |
| 口語音素 | en-US |
en-US |
音節群
發音評估可以提供音節層級的評估結果。 一個單字通常是逐音節發音,而不是每個音素。 以音節分組較易辨識,且與說話習慣相符。
發音評量僅支援 en-US 中搭配 IPA 和 SAPI 的音節群組。
下表比較了範例音素與對應的音節。
| 範例單字 | 音素 | 音節 |
|---|---|---|
| 科技 | teknələdʒɪkl | tek·nə·lɑ·dʒɪkl |
| 你好 | Hɛloʊ | hɛ·loʊ |
| 運氣 | lʌk | lʌk |
| 光合作用 | foʊtəsɪnθəsɪs | foʊ·tə·sɪn·θə·sɪs |
若要請求音節層級結果及音素,請將粒度 配置參數 設為 Phoneme。
音素字母格式
在 en-US 中,發音評估支援使用 IPA 的音素名稱;在 en-US 和 zh-CN 中,支援使用 SAPI 的音素名稱。
對於支援音名的地點,音素名稱會與樂譜一併提供。 音素名稱有助於辨識哪些音素發音準確或不準確。 對於其他地區設定,您只能取得音素分數。
下表比較了範例 SAPI 音素與對應的 IPA 音素。
| 範例單字 | SAPI 音素 | 國際音標音素 |
|---|---|---|
| 你好 | 你好 | h ɛ l oʊ |
| 運氣 | l 啊 k | L ʌ k |
| 光合作用 | f ow t ax s ih n th ax s ih s | f oʊ t ə s ɪ n θ ə s ɪ s |
要請求 IPA 音素,請將音素字母表設為 IPA。 如果你沒指定字母表,音素預設是 SAPI 格式。
pronunciationAssessmentConfig.PhonemeAlphabet = "IPA";
auto pronunciationAssessmentConfig = PronunciationAssessmentConfig::CreateFromJson("{\"referenceText\":\"good morning\",\"gradingSystem\":\"HundredMark\",\"granularity\":\"Phoneme\",\"phonemeAlphabet\":\"IPA\"}");
PronunciationAssessmentConfig pronunciationAssessmentConfig = PronunciationAssessmentConfig.fromJson("{\"referenceText\":\"good morning\",\"gradingSystem\":\"HundredMark\",\"granularity\":\"Phoneme\",\"phonemeAlphabet\":\"IPA\"}");
pronunciation_assessment_config = speechsdk.PronunciationAssessmentConfig(json_string="{\"referenceText\":\"good morning\",\"gradingSystem\":\"HundredMark\",\"granularity\":\"Phoneme\",\"phonemeAlphabet\":\"IPA\"}")
var pronunciationAssessmentConfig = SpeechSDK.PronunciationAssessmentConfig.fromJSON("{\"referenceText\":\"good morning\",\"gradingSystem\":\"HundredMark\",\"granularity\":\"Phoneme\",\"phonemeAlphabet\":\"IPA\"}");
pronunciationAssessmentConfig.phonemeAlphabet = @"IPA";
pronunciationAssessmentConfig?.phonemeAlphabet = "IPA"
評估口語音素
透過口說音素,您可以取得信賴分數,指出口說音素符合預期音素的可能性。
發音評量支援 en-US 中搭配 IPA 和 SAPI 的口說音素。
例如,若要取得 Hello 這個單字的完整口說聲音,您可以將每個預期音素中信賴分數最高的第一個口說音素串連起來。 在以下評估結果中,當你說出單字 hello時,預期的IPA音素為 h ɛ l oʊ。 不過,實際口說音素為 h ə l oʊ。 在這個例子中,每個預期音素都有五個可能的候選詞。 評估結果顯示,最有可能被說出的語音是 ə,而不是預期的語音 ɛ。 預期音素 ɛ 的信心分數僅為47。 其他潛在配對的信心分數分別為52、17和2。
{
"Id": "bbb42ea51bdb46d19a1d685e635fe173",
"RecognitionStatus": 0,
"Offset": 7500000,
"Duration": 13800000,
"DisplayText": "Hello.",
"NBest": [
{
"Confidence": 0.975003,
"Lexical": "hello",
"ITN": "hello",
"MaskedITN": "hello",
"Display": "Hello.",
"PronunciationAssessment": {
"AccuracyScore": 100,
"FluencyScore": 100,
"CompletenessScore": 100,
"PronScore": 100
},
"Words": [
{
"Word": "hello",
"Offset": 7500000,
"Duration": 13800000,
"PronunciationAssessment": {
"AccuracyScore": 99.0,
"ErrorType": "None"
},
"Syllables": [
{
"Syllable": "hɛ",
"PronunciationAssessment": {
"AccuracyScore": 91.0
},
"Offset": 7500000,
"Duration": 4100000
},
{
"Syllable": "loʊ",
"PronunciationAssessment": {
"AccuracyScore": 100.0
},
"Offset": 11700000,
"Duration": 9600000
}
],
"Phonemes": [
{
"Phoneme": "h",
"PronunciationAssessment": {
"AccuracyScore": 98.0,
"NBestPhonemes": [
{
"Phoneme": "h",
"Score": 100.0
},
{
"Phoneme": "oʊ",
"Score": 52.0
},
{
"Phoneme": "ə",
"Score": 35.0
},
{
"Phoneme": "k",
"Score": 23.0
},
{
"Phoneme": "æ",
"Score": 20.0
}
]
},
"Offset": 7500000,
"Duration": 3500000
},
{
"Phoneme": "ɛ",
"PronunciationAssessment": {
"AccuracyScore": 47.0,
"NBestPhonemes": [
{
"Phoneme": "ə",
"Score": 100.0
},
{
"Phoneme": "l",
"Score": 52.0
},
{
"Phoneme": "ɛ",
"Score": 47.0
},
{
"Phoneme": "h",
"Score": 17.0
},
{
"Phoneme": "æ",
"Score": 2.0
}
]
},
"Offset": 11100000,
"Duration": 500000
},
{
"Phoneme": "l",
"PronunciationAssessment": {
"AccuracyScore": 100.0,
"NBestPhonemes": [
{
"Phoneme": "l",
"Score": 100.0
},
{
"Phoneme": "oʊ",
"Score": 46.0
},
{
"Phoneme": "ə",
"Score": 5.0
},
{
"Phoneme": "ɛ",
"Score": 3.0
},
{
"Phoneme": "u",
"Score": 1.0
}
]
},
"Offset": 11700000,
"Duration": 1100000
},
{
"Phoneme": "oʊ",
"PronunciationAssessment": {
"AccuracyScore": 100.0,
"NBestPhonemes": [
{
"Phoneme": "oʊ",
"Score": 100.0
},
{
"Phoneme": "d",
"Score": 29.0
},
{
"Phoneme": "t",
"Score": 24.0
},
{
"Phoneme": "n",
"Score": 22.0
},
{
"Phoneme": "l",
"Score": 18.0
}
]
},
"Offset": 12900000,
"Duration": 8400000
}
]
}
]
}
]
}
為了表示是否以及需要針對多少個潛在的語音音素取得信心分數,請將參數設 NBestPhonemeCount 為整數值,例如 5。
pronunciationAssessmentConfig.NBestPhonemeCount = 5;
auto pronunciationAssessmentConfig = PronunciationAssessmentConfig::CreateFromJson("{\"referenceText\":\"good morning\",\"gradingSystem\":\"HundredMark\",\"granularity\":\"Phoneme\",\"phonemeAlphabet\":\"IPA\",\"nBestPhonemeCount\":5}");
PronunciationAssessmentConfig pronunciationAssessmentConfig = PronunciationAssessmentConfig.fromJson("{\"referenceText\":\"good morning\",\"gradingSystem\":\"HundredMark\",\"granularity\":\"Phoneme\",\"phonemeAlphabet\":\"IPA\",\"nBestPhonemeCount\":5}");
pronunciation_assessment_config = speechsdk.PronunciationAssessmentConfig(json_string="{\"referenceText\":\"good morning\",\"gradingSystem\":\"HundredMark\",\"granularity\":\"Phoneme\",\"phonemeAlphabet\":\"IPA\",\"nBestPhonemeCount\":5}")
var pronunciationAssessmentConfig = SpeechSDK.PronunciationAssessmentConfig.fromJSON("{\"referenceText\":\"good morning\",\"gradingSystem\":\"HundredMark\",\"granularity\":\"Phoneme\",\"phonemeAlphabet\":\"IPA\",\"nBestPhonemeCount\":5}");
pronunciationAssessmentConfig.nbestPhonemeCount = 5;
pronunciationAssessmentConfig?.nbestPhonemeCount = 5
發音分數計算
發音分數是根據特定公式,在閱讀與口說情境中,對準確度、韻律、流暢度及完整性分數進行加權計算。
當將準確度、韻律、流暢度與完整性分數從低到高排序(若各分數皆有),並將最低分數表示為 s0 到 s3,發音分數計算如下:
針對閱讀案例:
- 韻律分數:PronScore = 0.4 * s0 + 0.2 * s1 + 0.2 * s2 + 0.2 * s3
- 無韻律分數:PronScore = 0.6 * s0 + 0.2 * s1 + 0.2 * s2
對於口說情境(完整性分數不適用):
- 韻律分數:PronScore = 0.6 * s0 + 0.2 * s1 + 0.2 * s2
- 無韻律分數:PronScore = 0.6 * s0 + 0.4 * s1
此公式根據每個分數的重要性提供加權計算,確保發音的全面評估。
內容評析
重要
內容評估(預覽)已從 Speech SDK 1.46.0 及更新版本中退休。 作為替代方案,您也可以使用 Microsoft Foundry 模型中的 Azure OpenAI,取得本節所述的內容評估結果。
對於某些已辨識的語音,你也可能想取得詞彙、文法和主題相關性的評估結果。 你可以使用像 Azure OpenAI gpt-4o 這類聊天模型來取得內容評估結果。 欲了解更多使用聊天模型的資訊,請參閱 Azure OpenAI 模型 以及 Azure AI 模型推論 API chat 完成參考文件。
使用者與系統訊息用來設定聊天模式的上下文。 以下範例中,使用者訊息包含待評量的論文,系統訊息則提供如何評估該論文的指示。
{
"messages": [
{
"role": "system",
"content": "You are an English teacher and please help to grade a student's essay from vocabulary and grammar and topic relevance on how well the essay aligns with the title, and output format as: {\"vocabulary\": *.*(0-100), \"grammar\": *.*(0-100), \"topic\": *.*(0-100)}."
},
{
"role": "user",
"content": "Example1: this essay: \"sampleSentence1\" has vocabulary and grammar scores of ** and **, respectively. Example2: this essay: \"sampleSentence2\" has vocabulary and grammar scores of ** and **, respectively. Example3: this essay: \"sampleSentence3\" has vocabulary and grammar scores of ** and **, respectively. The essay for you to score is \"sendText\", and the title is \"topic\". The transcript is from speech recognition so that please first add punctuations when needed, remove duplicates and unnecessary un uh from oral speech, then find all the misuse of words and grammar errors in this essay, find advanced words and grammar usages, and finally give scores based on this information. Please only respond as this format {\"vocabulary\": *.*(0-100), \"grammar\": *.*(0-100)}, \"topic\": *.*(0-100)}. [THE TRANSCRIPT FROM SPEECH RECOGNITION IS REDACTED FOR BREVITY]"
}
]
}