|
1 | 1 | /*
|
2 |
| - * (C) Copyright IBM Corp. 2019. |
| 2 | + * (C) Copyright IBM Corp. 2020. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
5 | 5 | * the License. You may obtain a copy of the License at
|
|
23 | 23 | */
|
24 | 24 | public class SpeechRecognitionResult extends GenericModel {
|
25 | 25 |
|
| 26 | + /** |
| 27 | + * If the `split_transcript_at_phrase_end` parameter is `true`, describes the reason for the split: |
| 28 | + * * `end_of_data` - The end of the input audio stream. |
| 29 | + * * `full_stop` - A full semantic stop, such as for the conclusion of a grammatical sentence. The insertion of splits |
| 30 | + * is influenced by the base language model and biased by custom language models and grammars. |
| 31 | + * * `reset` - The amount of audio that is currently being processed exceeds the two-minute maximum. The service |
| 32 | + * splits the transcript to avoid excessive memory use. |
| 33 | + * * `silence` - A pause or silence that is at least as long as the pause interval. |
| 34 | + */ |
| 35 | + public interface EndOfUtterance { |
| 36 | + /** end_of_data. */ |
| 37 | + String END_OF_DATA = "end_of_data"; |
| 38 | + /** full_stop. */ |
| 39 | + String FULL_STOP = "full_stop"; |
| 40 | + /** reset. */ |
| 41 | + String RESET = "reset"; |
| 42 | + /** silence. */ |
| 43 | + String SILENCE = "silence"; |
| 44 | + } |
| 45 | + |
26 | 46 | @SerializedName("final")
|
27 |
| - private Boolean xFinal; |
28 |
| - private List<SpeechRecognitionAlternative> alternatives; |
| 47 | + protected Boolean xFinal; |
| 48 | + protected List<SpeechRecognitionAlternative> alternatives; |
29 | 49 | @SerializedName("keywords_result")
|
30 |
| - private Map<String, List<KeywordResult>> keywordsResult; |
| 50 | + protected Map<String, List<KeywordResult>> keywordsResult; |
31 | 51 | @SerializedName("word_alternatives")
|
32 |
| - private List<WordAlternativeResults> wordAlternatives; |
| 52 | + protected List<WordAlternativeResults> wordAlternatives; |
| 53 | + @SerializedName("end_of_utterance") |
| 54 | + protected String endOfUtterance; |
33 | 55 |
|
34 | 56 | /**
|
35 | 57 | * Gets the xFinal.
|
@@ -80,4 +102,21 @@ public Map<String, List<KeywordResult>> getKeywordsResult() {
|
80 | 102 | public List<WordAlternativeResults> getWordAlternatives() {
|
81 | 103 | return wordAlternatives;
|
82 | 104 | }
|
| 105 | + |
| 106 | + /** |
| 107 | + * Gets the endOfUtterance. |
| 108 | + * |
| 109 | + * If the `split_transcript_at_phrase_end` parameter is `true`, describes the reason for the split: |
| 110 | + * * `end_of_data` - The end of the input audio stream. |
| 111 | + * * `full_stop` - A full semantic stop, such as for the conclusion of a grammatical sentence. The insertion of splits |
| 112 | + * is influenced by the base language model and biased by custom language models and grammars. |
| 113 | + * * `reset` - The amount of audio that is currently being processed exceeds the two-minute maximum. The service |
| 114 | + * splits the transcript to avoid excessive memory use. |
| 115 | + * * `silence` - A pause or silence that is at least as long as the pause interval. |
| 116 | + * |
| 117 | + * @return the endOfUtterance |
| 118 | + */ |
| 119 | + public String getEndOfUtterance() { |
| 120 | + return endOfUtterance; |
| 121 | + } |
83 | 122 | }
|
0 commit comments