Skip to content

Commit 0433887

Browse files
committed
feat(SpeechToText): add support for endOfPhraseSilenceTime and splitTranscriptAtPhraseEnd
1 parent c90ccaa commit 0433887

File tree

3 files changed

+137
-61
lines changed

3 files changed

+137
-61
lines changed

Scripts/Services/SpeechToText/V1/Model/SpeechRecognitionResult.cs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2018, 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,48 @@ namespace IBM.Watson.SpeechToText.V1.Model
2525
/// </summary>
2626
public class SpeechRecognitionResult
2727
{
28+
/// <summary>
29+
/// If the `split_transcript_at_phrase_end` parameter is `true`, describes the reason for the split:
30+
/// * `end_of_data` - The end of the input audio stream.
31+
/// * `full_stop` - A full semantic stop, such as for the conclusion of a grammatical sentence. The insertion of
32+
/// splits is influenced by the base language model and biased by custom language models and grammars.
33+
/// * `reset` - The amount of audio that is currently being processed exceeds the two-minute maximum. The
34+
/// service splits the transcript to avoid excessive memory use.
35+
/// * `silence` - A pause or silence that is at least as long as the pause interval.
36+
/// </summary>
37+
public class EndOfUtteranceValue
38+
{
39+
/// <summary>
40+
/// Constant END_OF_DATA for end_of_data
41+
/// </summary>
42+
public const string END_OF_DATA = "end_of_data";
43+
/// <summary>
44+
/// Constant FULL_STOP for full_stop
45+
/// </summary>
46+
public const string FULL_STOP = "full_stop";
47+
/// <summary>
48+
/// Constant RESET for reset
49+
/// </summary>
50+
public const string RESET = "reset";
51+
/// <summary>
52+
/// Constant SILENCE for silence
53+
/// </summary>
54+
public const string SILENCE = "silence";
55+
56+
}
57+
58+
/// <summary>
59+
/// If the `split_transcript_at_phrase_end` parameter is `true`, describes the reason for the split:
60+
/// * `end_of_data` - The end of the input audio stream.
61+
/// * `full_stop` - A full semantic stop, such as for the conclusion of a grammatical sentence. The insertion of
62+
/// splits is influenced by the base language model and biased by custom language models and grammars.
63+
/// * `reset` - The amount of audio that is currently being processed exceeds the two-minute maximum. The
64+
/// service splits the transcript to avoid excessive memory use.
65+
/// * `silence` - A pause or silence that is at least as long as the pause interval.
66+
/// Constants for possible values can be found using SpeechRecognitionResult.EndOfUtteranceValue
67+
/// </summary>
68+
[JsonProperty("end_of_utterance", NullValueHandling = NullValueHandling.Ignore)]
69+
public string EndOfUtterance { get; set; }
2870
/// <summary>
2971
/// An indication of whether the transcription results are final. If `true`, the results for this utterance are
3072
/// not updated further; no additional results are sent for a `result_index` once its results are indicated as

0 commit comments

Comments
 (0)