tencentcloud-sdk-python-intl-en 3.0.1094__py2.py3-none-any.whl → 3.0.1096__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tencentcloud-sdk-python-intl-en might be problematic. Click here for more details.
- tencentcloud/__init__.py +1 -1
- tencentcloud/asr/__init__.py +0 -0
- tencentcloud/asr/v20190614/__init__.py +0 -0
- tencentcloud/asr/v20190614/asr_client.py +87 -0
- tencentcloud/asr/v20190614/errorcodes.py +66 -0
- tencentcloud/asr/v20190614/models.py +1293 -0
- tencentcloud/dts/v20180330/dts_client.py +0 -23
- tencentcloud/dts/v20180330/errorcodes.py +71 -14
- tencentcloud/dts/v20180330/models.py +57 -232
- tencentcloud/dts/v20211206/dts_client.py +1 -1
- tencentcloud/mps/v20190612/errorcodes.py +2 -173
- tencentcloud/mps/v20190612/models.py +939 -145
- tencentcloud/mps/v20190612/mps_client.py +25 -0
- tencentcloud/ocr/v20181119/models.py +45 -0
- {tencentcloud_sdk_python_intl_en-3.0.1094.dist-info → tencentcloud_sdk_python_intl_en-3.0.1096.dist-info}/METADATA +1 -1
- {tencentcloud_sdk_python_intl_en-3.0.1094.dist-info → tencentcloud_sdk_python_intl_en-3.0.1096.dist-info}/RECORD +18 -13
- {tencentcloud_sdk_python_intl_en-3.0.1094.dist-info → tencentcloud_sdk_python_intl_en-3.0.1096.dist-info}/WHEEL +0 -0
- {tencentcloud_sdk_python_intl_en-3.0.1094.dist-info → tencentcloud_sdk_python_intl_en-3.0.1096.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,1293 @@
|
|
|
1
|
+
# -*- coding: utf8 -*-
|
|
2
|
+
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
import warnings
|
|
17
|
+
|
|
18
|
+
from tencentcloud.common.abstract_model import AbstractModel
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class CreateRecTaskRequest(AbstractModel):
|
|
22
|
+
"""CreateRecTask request structure.
|
|
23
|
+
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def __init__(self):
|
|
27
|
+
r"""
|
|
28
|
+
:param _EngineModelType: Engine model type.
|
|
29
|
+
Each recognition engine adopts a specific billing plan. Engines marked with "large model version" adopt the large model billing plan. For product billing instructions, [click here] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1).
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
Note: If you want to recognize telecommunication audio but find that a 16k engine is required, you can use a 16k engine as described below for recognition. However, ** the 16k engines are not trained for recognizing telecommunication audio. Therefore, the recognition results cannot be guaranteed. You need to check whether the recognition results can be used. **
|
|
33
|
+
|
|
34
|
+
Engines for general scenarios:
|
|
35
|
+
** Note: Use 16k engines for scenarios other than telecommunication. **
|
|
36
|
+
** 16k_zh_large: ** Engine (large model version) for Mandarin, Chinese dialects, and English. This engine supports recognizing audio in Chinese, English, and [various Chinese dialects] (https://intl.cloud.tencent.com/document/product/1093/35682?from_cn_redirect=1). It has a large number of parameters, enhanced performance, and greatly improved recognition accuracy for low-quality audio with loud noise, too much echo, low voice volume, or faint voices. [Click here] (https://console.cloud.tencent.com/asr/demonstrate) to compare the recognition performance of the 16k_zh engine and this one.
|
|
37
|
+
** 16k_multi_lang: ** Engine (large model version) for multiple languages. This engine supports recognizing audio in English, Japanese, Korean, Arabic, Filipino, French, Hindi, Indonesian, Malay, Portuguese, Spanish, Thai, Turkish, Vietnamese, and German (sentence-level or paragraph-level).
|
|
38
|
+
** 16k_zh-PY: ** Engine for Chinese, English, and Cantonese. The engine supports recognizing audio in Mandarin, English, and Cantonese at the same time.
|
|
39
|
+
** 16k_ms: ** Engine for Malay.
|
|
40
|
+
** 16k_id: ** Engine for Indonesian.
|
|
41
|
+
** 16k_th: ** Engine for Thai.
|
|
42
|
+
:type EngineModelType: str
|
|
43
|
+
:param _ChannelNum: Number of recognition channels.
|
|
44
|
+
1: Mono. (16k engines only support mono. ** Do no t** set to stereo.)
|
|
45
|
+
2: Stereo. (Stereo is supported only for 8k engines, and the two channels should correspond to the respective communication parties.)
|
|
46
|
+
|
|
47
|
+
Note:
|
|
48
|
+
16k engines: Only support mono. ** ChannelNum should be set to 1 **.
|
|
49
|
+
8k engines: Support both mono and stereo. ** It is recommended to set ChannelNum to 2 (indicating stereo) **. Stereo can physically distinguish speakers to avoid recognition mistakes caused by overlapping speech. It can provide the best speaker separation and recognition effects. Once stereo is set, the speakers are automatically separated. ** You do not need to enable the speaker separation feature **. You can use the default values for related parameters (** SpeakerDiarization and SpeakerNumber **). For speakerId in the returned ResultDetail, the value 0 represents the left channel, and the value 1 represents the right channel.
|
|
50
|
+
:type ChannelNum: int
|
|
51
|
+
:param _ResTextFormat: Format of the returned recognition result.
|
|
52
|
+
0: The basic recognition result (containing only valid voice timestamps but no word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail)).
|
|
53
|
+
1: The basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps and speech speed value but ** no punctuation **).
|
|
54
|
+
2: The basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps, speech speed value, and ** punctuation **).
|
|
55
|
+
3: The basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps, speech speed value, and ** punctuation **). The recognition results are segmented by punctuation. ** This format applies to subtitle scenarios **.
|
|
56
|
+
4: ** [Value-added paid feature] ** The basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps, speech speed value, and ** punctuation **). The recognition results are segmented by NLP semantics. ** This format applies to scenarios such as meeting and court record transcription ** and is supported only for 8k_zh and 16k_zh engines.
|
|
57
|
+
5: ** [Value-added paid feature] ** Basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps, speech speed value, and ** punctuation **). The oral-to-written transcription result is also output, which has excluded modal particles and consecutive identical words, optimized expressions, and corrected speech mistakes. ** This format applies to scenarios of generating minutes for online and offline meetings** and is supported only for 8k_zh and 16k_zh engines.
|
|
58
|
+
|
|
59
|
+
Notes:
|
|
60
|
+
If this parameter is set to 4, make sure that a [semantics-based segmentation resource package] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1#97ae4aa0-29a0-4066-9f07-ccaf8856a16b) is purchased for your account or that your account has enabled post-payment. ** If post-payment is enabled and this parameter is set to 4, [automatic billing] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1#d912167d-ffd5-41a9-8b1c-2e89845a6852) will apply **.
|
|
61
|
+
If this parameter is set to 5, make sure that an [oral-to-written resource package] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1#97ae4aa0-29a0-4066-9f07-ccaf8856a16b) is purchased for your account or that your account has enabled post-payment. ** If post-payment is enabled and this parameter is set to 5, [automatic billing] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1#d912167d-ffd5-41a9-8b1c-2e89845a6852) will apply **.
|
|
62
|
+
:type ResTextFormat: int
|
|
63
|
+
:param _SourceType: Audio source.
|
|
64
|
+
0: Audio URL.
|
|
65
|
+
1: Local audio file (body of the POST request).
|
|
66
|
+
:type SourceType: int
|
|
67
|
+
:param _Data: Audio file Base64 code.
|
|
68
|
+
** This parameter is required if SourceType is set to 1. Otherwise, it can be left blank. **
|
|
69
|
+
|
|
70
|
+
Note: The audio data size cannot exceed 5 MB.
|
|
71
|
+
:type Data: str
|
|
72
|
+
:param _DataLen: Data length (before Base64 encoding).
|
|
73
|
+
:type DataLen: int
|
|
74
|
+
:param _Url: Audio URL. (The audio should be downloadable via a public network browser.)
|
|
75
|
+
** This parameter is required if SourceType is set to 0. Otherwise, it can be left blank. **
|
|
76
|
+
|
|
77
|
+
Notes:
|
|
78
|
+
1. Make sure that the total audio duration of recording files does not exceed 5 hours. Otherwise, recognition may fail.
|
|
79
|
+
2. Pay attention to file download to avoid download failure.
|
|
80
|
+
:type Url: str
|
|
81
|
+
:param _CallbackUrl: Callback URL
|
|
82
|
+
|
|
83
|
+
User-defined service URL for receiving recognition results.
|
|
84
|
+
For the callback format and content, see [Callback Description] (https://intl.cloud.tencent.com/document/product/1093/52632?from_cn_redirect=1).
|
|
85
|
+
|
|
86
|
+
Notes:
|
|
87
|
+
|
|
88
|
+
- If you use the polling method to obtain recognition results, this parameter is not required.
|
|
89
|
+
- It is recommended to include your business ID and other information in the callback URL for handling business logic.
|
|
90
|
+
:type CallbackUrl: str
|
|
91
|
+
:param _SpeakerDiarization: Whether to enable speaker separation.
|
|
92
|
+
0: Disable.
|
|
93
|
+
1: Enable. (This value is supported only for the following engines: 8k_zh, 16k_zh, 16k_ms, 16k_en, 16k_id, 16k_zh_large, and 16k_zh_dialect. ChannelNum should be set to 1.)
|
|
94
|
+
The default value is 0.
|
|
95
|
+
|
|
96
|
+
Note:
|
|
97
|
+
If an 8k engine is used and ChannelNum is set to 2 (stereo), use the default values for corresponding parameters as stated in the ** ChannelNum ** parameter description.
|
|
98
|
+
:type SpeakerDiarization: int
|
|
99
|
+
:param _SpeakerNumber: Number of speakers to be separated.
|
|
100
|
+
** Speaker separation must be enabled. Otherwise, this parameter does not take effect. ** Value range: 0-10.
|
|
101
|
+
0: Automatic separation. (Up to 20 speakers can be separated.)
|
|
102
|
+
1-10: Specify the number of speakers.
|
|
103
|
+
The default value is 0.
|
|
104
|
+
:type SpeakerNumber: int
|
|
105
|
+
:param _HotwordId: This service is not available.
|
|
106
|
+
:type HotwordId: str
|
|
107
|
+
:param _ReinforceHotword: This service is not available.
|
|
108
|
+
:type ReinforceHotword: int
|
|
109
|
+
:param _CustomizationId: This service is not available.
|
|
110
|
+
:type CustomizationId: str
|
|
111
|
+
:param _EmotionRecognition: This service is not available.
|
|
112
|
+
:type EmotionRecognition: int
|
|
113
|
+
:param _EmotionalEnergy: Emotional energy value.
|
|
114
|
+
The value is the result of dividing the sound volume in dB by 10. Value range: [1,10]. The higher the value, the stronger the emotion.
|
|
115
|
+
0: Disable.
|
|
116
|
+
1: Enable.
|
|
117
|
+
The default value is 0.
|
|
118
|
+
:type EmotionalEnergy: int
|
|
119
|
+
:param _ConvertNumMode: Intelligent conversion into Arabic numerals (supported only for engines for recognizing audio in Mandarin).
|
|
120
|
+
0: Do not convert, but directly output Chinese numerals.
|
|
121
|
+
1: Intelligently convert into Arabic numerals based on the scenario.
|
|
122
|
+
3: Enable conversion for math-related letters.
|
|
123
|
+
The default value is 1.
|
|
124
|
+
:type ConvertNumMode: int
|
|
125
|
+
:param _FilterDirty: Dirty word filtering (supported only for engines for recognizing audio in Mandarin).
|
|
126
|
+
0: Do not filter out dirty words.
|
|
127
|
+
1: Filter out dirty words.
|
|
128
|
+
2: Replace dirty words with *.
|
|
129
|
+
The default value is 0.
|
|
130
|
+
:type FilterDirty: int
|
|
131
|
+
:param _FilterPunc: Punctuation filtering (supported only for engines for recognizing audio in Mandarin).
|
|
132
|
+
0: Do not filter out punctuation.
|
|
133
|
+
1: Filter out sentence-ending punctuation.
|
|
134
|
+
2: Filter out all punctuation.
|
|
135
|
+
The default value is 0.
|
|
136
|
+
:type FilterPunc: int
|
|
137
|
+
:param _FilterModal: Modal particle filtering (supported only for engines for recognizing audio in Mandarin).
|
|
138
|
+
0: Do not filter out modal particles.
|
|
139
|
+
1: Filter out specified modal particles.
|
|
140
|
+
2: Filter out all modal particles.
|
|
141
|
+
The default value is 0.
|
|
142
|
+
:type FilterModal: int
|
|
143
|
+
:param _SentenceMaxLength: The maximum number of characters per line (supported only for engines for recognizing audio in Mandarin). A punctuation mark is added if this limit is reached.
|
|
144
|
+
** This parameter can control the maximum number of characters per line, which applies to subtitle generation scenarios. ** Value range: [6,40].
|
|
145
|
+
0: Disable this feature.
|
|
146
|
+
The default value is 0.
|
|
147
|
+
|
|
148
|
+
Note: To enable this feature, ResTextFormat should be set to 3. The recognition result can be obtained from FinalSentence by parsing the list in the returned ResultDetail.
|
|
149
|
+
:type SentenceMaxLength: int
|
|
150
|
+
:param _Extra: Additional parameter. ** (This parameter is meaningless. Ignore it.) **
|
|
151
|
+
:type Extra: str
|
|
152
|
+
:param _HotwordList: Temporary term list. This parameter is used to improve the recognition accuracy.
|
|
153
|
+
|
|
154
|
+
- Restrictions for individual terms: The format is "term|weight". Each term can contain no more than 30 characters (or 10 Chinese characters. The weight can be in the range of [1-11] or 100. For example, "Tencent Cloud|5" or "ASR|11".
|
|
155
|
+
|
|
156
|
+
- Restrictions for the temporary term list: Multiple terms are separated by commas. The list can contain up to 128 terms. For example, "Tencent Cloud|10, Audio Recognition|5, ASR|11".
|
|
157
|
+
|
|
158
|
+
- Difference between hotword_id (term list) and hotword_list (temporary term list):
|
|
159
|
+
|
|
160
|
+
- hotword_id: Term list. You need to create a term list in the console or by using the API first and obtain the term list ID.
|
|
161
|
+
|
|
162
|
+
- hotword_list: Temporary term list. You can directly enter the ID of the temporary term list each time you initiate a request. The temporary term list is not retained on the cloud. This parameter applies to users with a massive number of terms.
|
|
163
|
+
|
|
164
|
+
Notes:
|
|
165
|
+
|
|
166
|
+
- If both hotword_id and hotword_list are specified, hotword_list will take effect first.
|
|
167
|
+
|
|
168
|
+
- When the weight of a term is set to 11, this term becomes a super term. It is recommended that the weight is set to 11 only for critical and necessary terms. The overall accuracy will be affected if the weight is set to 11 for too many terms.
|
|
169
|
+
|
|
170
|
+
- When the weight of a term is set to 100, the term enhancement feature is enabled to replace homophones of this term. (This feature is supported only for 8k_zh and 16k_zh engines.) For example, if you configure "mizhi 1|100", the recognized word "mizhi 2", which is a homophone of "mizhi 2", will be forcibly replaced with "mizhi 2". It is recommended that you enable this feature based on the actual needs. You can set the weight to 100 for only critical and necessary terms. The overall accuracy will be affected if the weight is set to 100 for too many terms.
|
|
171
|
+
:type HotwordList: str
|
|
172
|
+
:param _KeyWordLibIdList: List of keyword IDs for recognition. This parameter is left blank by default, indicating that no keyword is recognized. You can enter up to 10 IDs.
|
|
173
|
+
|
|
174
|
+
:type KeyWordLibIdList: list of str
|
|
175
|
+
"""
|
|
176
|
+
self._EngineModelType = None
|
|
177
|
+
self._ChannelNum = None
|
|
178
|
+
self._ResTextFormat = None
|
|
179
|
+
self._SourceType = None
|
|
180
|
+
self._Data = None
|
|
181
|
+
self._DataLen = None
|
|
182
|
+
self._Url = None
|
|
183
|
+
self._CallbackUrl = None
|
|
184
|
+
self._SpeakerDiarization = None
|
|
185
|
+
self._SpeakerNumber = None
|
|
186
|
+
self._HotwordId = None
|
|
187
|
+
self._ReinforceHotword = None
|
|
188
|
+
self._CustomizationId = None
|
|
189
|
+
self._EmotionRecognition = None
|
|
190
|
+
self._EmotionalEnergy = None
|
|
191
|
+
self._ConvertNumMode = None
|
|
192
|
+
self._FilterDirty = None
|
|
193
|
+
self._FilterPunc = None
|
|
194
|
+
self._FilterModal = None
|
|
195
|
+
self._SentenceMaxLength = None
|
|
196
|
+
self._Extra = None
|
|
197
|
+
self._HotwordList = None
|
|
198
|
+
self._KeyWordLibIdList = None
|
|
199
|
+
|
|
200
|
+
@property
|
|
201
|
+
def EngineModelType(self):
|
|
202
|
+
"""Engine model type.
|
|
203
|
+
Each recognition engine adopts a specific billing plan. Engines marked with "large model version" adopt the large model billing plan. For product billing instructions, [click here] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1).
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
Note: If you want to recognize telecommunication audio but find that a 16k engine is required, you can use a 16k engine as described below for recognition. However, ** the 16k engines are not trained for recognizing telecommunication audio. Therefore, the recognition results cannot be guaranteed. You need to check whether the recognition results can be used. **
|
|
207
|
+
|
|
208
|
+
Engines for general scenarios:
|
|
209
|
+
** Note: Use 16k engines for scenarios other than telecommunication. **
|
|
210
|
+
** 16k_zh_large: ** Engine (large model version) for Mandarin, Chinese dialects, and English. This engine supports recognizing audio in Chinese, English, and [various Chinese dialects] (https://intl.cloud.tencent.com/document/product/1093/35682?from_cn_redirect=1). It has a large number of parameters, enhanced performance, and greatly improved recognition accuracy for low-quality audio with loud noise, too much echo, low voice volume, or faint voices. [Click here] (https://console.cloud.tencent.com/asr/demonstrate) to compare the recognition performance of the 16k_zh engine and this one.
|
|
211
|
+
** 16k_multi_lang: ** Engine (large model version) for multiple languages. This engine supports recognizing audio in English, Japanese, Korean, Arabic, Filipino, French, Hindi, Indonesian, Malay, Portuguese, Spanish, Thai, Turkish, Vietnamese, and German (sentence-level or paragraph-level).
|
|
212
|
+
** 16k_zh-PY: ** Engine for Chinese, English, and Cantonese. The engine supports recognizing audio in Mandarin, English, and Cantonese at the same time.
|
|
213
|
+
** 16k_ms: ** Engine for Malay.
|
|
214
|
+
** 16k_id: ** Engine for Indonesian.
|
|
215
|
+
** 16k_th: ** Engine for Thai.
|
|
216
|
+
:rtype: str
|
|
217
|
+
"""
|
|
218
|
+
return self._EngineModelType
|
|
219
|
+
|
|
220
|
+
@EngineModelType.setter
|
|
221
|
+
def EngineModelType(self, EngineModelType):
|
|
222
|
+
self._EngineModelType = EngineModelType
|
|
223
|
+
|
|
224
|
+
@property
|
|
225
|
+
def ChannelNum(self):
|
|
226
|
+
"""Number of recognition channels.
|
|
227
|
+
1: Mono. (16k engines only support mono. ** Do no t** set to stereo.)
|
|
228
|
+
2: Stereo. (Stereo is supported only for 8k engines, and the two channels should correspond to the respective communication parties.)
|
|
229
|
+
|
|
230
|
+
Note:
|
|
231
|
+
16k engines: Only support mono. ** ChannelNum should be set to 1 **.
|
|
232
|
+
8k engines: Support both mono and stereo. ** It is recommended to set ChannelNum to 2 (indicating stereo) **. Stereo can physically distinguish speakers to avoid recognition mistakes caused by overlapping speech. It can provide the best speaker separation and recognition effects. Once stereo is set, the speakers are automatically separated. ** You do not need to enable the speaker separation feature **. You can use the default values for related parameters (** SpeakerDiarization and SpeakerNumber **). For speakerId in the returned ResultDetail, the value 0 represents the left channel, and the value 1 represents the right channel.
|
|
233
|
+
:rtype: int
|
|
234
|
+
"""
|
|
235
|
+
return self._ChannelNum
|
|
236
|
+
|
|
237
|
+
@ChannelNum.setter
|
|
238
|
+
def ChannelNum(self, ChannelNum):
|
|
239
|
+
self._ChannelNum = ChannelNum
|
|
240
|
+
|
|
241
|
+
@property
|
|
242
|
+
def ResTextFormat(self):
|
|
243
|
+
"""Format of the returned recognition result.
|
|
244
|
+
0: The basic recognition result (containing only valid voice timestamps but no word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail)).
|
|
245
|
+
1: The basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps and speech speed value but ** no punctuation **).
|
|
246
|
+
2: The basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps, speech speed value, and ** punctuation **).
|
|
247
|
+
3: The basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps, speech speed value, and ** punctuation **). The recognition results are segmented by punctuation. ** This format applies to subtitle scenarios **.
|
|
248
|
+
4: ** [Value-added paid feature] ** The basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps, speech speed value, and ** punctuation **). The recognition results are segmented by NLP semantics. ** This format applies to scenarios such as meeting and court record transcription ** and is supported only for 8k_zh and 16k_zh engines.
|
|
249
|
+
5: ** [Value-added paid feature] ** Basic recognition result and word-level [detailed recognition result] (https://intl.cloud.tencent.com/document/api/1093/37824?from_cn_redirect=1#SentenceDetail) (containing word-level timestamps, speech speed value, and ** punctuation **). The oral-to-written transcription result is also output, which has excluded modal particles and consecutive identical words, optimized expressions, and corrected speech mistakes. ** This format applies to scenarios of generating minutes for online and offline meetings** and is supported only for 8k_zh and 16k_zh engines.
|
|
250
|
+
|
|
251
|
+
Notes:
|
|
252
|
+
If this parameter is set to 4, make sure that a [semantics-based segmentation resource package] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1#97ae4aa0-29a0-4066-9f07-ccaf8856a16b) is purchased for your account or that your account has enabled post-payment. ** If post-payment is enabled and this parameter is set to 4, [automatic billing] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1#d912167d-ffd5-41a9-8b1c-2e89845a6852) will apply **.
|
|
253
|
+
If this parameter is set to 5, make sure that an [oral-to-written resource package] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1#97ae4aa0-29a0-4066-9f07-ccaf8856a16b) is purchased for your account or that your account has enabled post-payment. ** If post-payment is enabled and this parameter is set to 5, [automatic billing] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1#d912167d-ffd5-41a9-8b1c-2e89845a6852) will apply **.
|
|
254
|
+
:rtype: int
|
|
255
|
+
"""
|
|
256
|
+
return self._ResTextFormat
|
|
257
|
+
|
|
258
|
+
@ResTextFormat.setter
|
|
259
|
+
def ResTextFormat(self, ResTextFormat):
|
|
260
|
+
self._ResTextFormat = ResTextFormat
|
|
261
|
+
|
|
262
|
+
@property
|
|
263
|
+
def SourceType(self):
|
|
264
|
+
"""Audio source.
|
|
265
|
+
0: Audio URL.
|
|
266
|
+
1: Local audio file (body of the POST request).
|
|
267
|
+
:rtype: int
|
|
268
|
+
"""
|
|
269
|
+
return self._SourceType
|
|
270
|
+
|
|
271
|
+
@SourceType.setter
|
|
272
|
+
def SourceType(self, SourceType):
|
|
273
|
+
self._SourceType = SourceType
|
|
274
|
+
|
|
275
|
+
@property
|
|
276
|
+
def Data(self):
|
|
277
|
+
"""Audio file Base64 code.
|
|
278
|
+
** This parameter is required if SourceType is set to 1. Otherwise, it can be left blank. **
|
|
279
|
+
|
|
280
|
+
Note: The audio data size cannot exceed 5 MB.
|
|
281
|
+
:rtype: str
|
|
282
|
+
"""
|
|
283
|
+
return self._Data
|
|
284
|
+
|
|
285
|
+
@Data.setter
|
|
286
|
+
def Data(self, Data):
|
|
287
|
+
self._Data = Data
|
|
288
|
+
|
|
289
|
+
@property
|
|
290
|
+
def DataLen(self):
|
|
291
|
+
"""Data length (before Base64 encoding).
|
|
292
|
+
:rtype: int
|
|
293
|
+
"""
|
|
294
|
+
return self._DataLen
|
|
295
|
+
|
|
296
|
+
@DataLen.setter
|
|
297
|
+
def DataLen(self, DataLen):
|
|
298
|
+
self._DataLen = DataLen
|
|
299
|
+
|
|
300
|
+
@property
|
|
301
|
+
def Url(self):
|
|
302
|
+
"""Audio URL. (The audio should be downloadable via a public network browser.)
|
|
303
|
+
** This parameter is required if SourceType is set to 0. Otherwise, it can be left blank. **
|
|
304
|
+
|
|
305
|
+
Notes:
|
|
306
|
+
1. Make sure that the total audio duration of recording files does not exceed 5 hours. Otherwise, recognition may fail.
|
|
307
|
+
2. Pay attention to file download to avoid download failure.
|
|
308
|
+
:rtype: str
|
|
309
|
+
"""
|
|
310
|
+
return self._Url
|
|
311
|
+
|
|
312
|
+
@Url.setter
|
|
313
|
+
def Url(self, Url):
|
|
314
|
+
self._Url = Url
|
|
315
|
+
|
|
316
|
+
@property
|
|
317
|
+
def CallbackUrl(self):
|
|
318
|
+
"""Callback URL
|
|
319
|
+
|
|
320
|
+
User-defined service URL for receiving recognition results.
|
|
321
|
+
For the callback format and content, see [Callback Description] (https://intl.cloud.tencent.com/document/product/1093/52632?from_cn_redirect=1).
|
|
322
|
+
|
|
323
|
+
Notes:
|
|
324
|
+
|
|
325
|
+
- If you use the polling method to obtain recognition results, this parameter is not required.
|
|
326
|
+
- It is recommended to include your business ID and other information in the callback URL for handling business logic.
|
|
327
|
+
:rtype: str
|
|
328
|
+
"""
|
|
329
|
+
return self._CallbackUrl
|
|
330
|
+
|
|
331
|
+
@CallbackUrl.setter
|
|
332
|
+
def CallbackUrl(self, CallbackUrl):
|
|
333
|
+
self._CallbackUrl = CallbackUrl
|
|
334
|
+
|
|
335
|
+
@property
|
|
336
|
+
def SpeakerDiarization(self):
|
|
337
|
+
"""Whether to enable speaker separation.
|
|
338
|
+
0: Disable.
|
|
339
|
+
1: Enable. (This value is supported only for the following engines: 8k_zh, 16k_zh, 16k_ms, 16k_en, 16k_id, 16k_zh_large, and 16k_zh_dialect. ChannelNum should be set to 1.)
|
|
340
|
+
The default value is 0.
|
|
341
|
+
|
|
342
|
+
Note:
|
|
343
|
+
If an 8k engine is used and ChannelNum is set to 2 (stereo), use the default values for corresponding parameters as stated in the ** ChannelNum ** parameter description.
|
|
344
|
+
:rtype: int
|
|
345
|
+
"""
|
|
346
|
+
return self._SpeakerDiarization
|
|
347
|
+
|
|
348
|
+
@SpeakerDiarization.setter
|
|
349
|
+
def SpeakerDiarization(self, SpeakerDiarization):
|
|
350
|
+
self._SpeakerDiarization = SpeakerDiarization
|
|
351
|
+
|
|
352
|
+
@property
|
|
353
|
+
def SpeakerNumber(self):
|
|
354
|
+
"""Number of speakers to be separated.
|
|
355
|
+
** Speaker separation must be enabled. Otherwise, this parameter does not take effect. ** Value range: 0-10.
|
|
356
|
+
0: Automatic separation. (Up to 20 speakers can be separated.)
|
|
357
|
+
1-10: Specify the number of speakers.
|
|
358
|
+
The default value is 0.
|
|
359
|
+
:rtype: int
|
|
360
|
+
"""
|
|
361
|
+
return self._SpeakerNumber
|
|
362
|
+
|
|
363
|
+
@SpeakerNumber.setter
|
|
364
|
+
def SpeakerNumber(self, SpeakerNumber):
|
|
365
|
+
self._SpeakerNumber = SpeakerNumber
|
|
366
|
+
|
|
367
|
+
@property
|
|
368
|
+
def HotwordId(self):
|
|
369
|
+
"""This service is not available.
|
|
370
|
+
:rtype: str
|
|
371
|
+
"""
|
|
372
|
+
return self._HotwordId
|
|
373
|
+
|
|
374
|
+
@HotwordId.setter
|
|
375
|
+
def HotwordId(self, HotwordId):
|
|
376
|
+
self._HotwordId = HotwordId
|
|
377
|
+
|
|
378
|
+
@property
|
|
379
|
+
def ReinforceHotword(self):
|
|
380
|
+
warnings.warn("parameter `ReinforceHotword` is deprecated", DeprecationWarning)
|
|
381
|
+
|
|
382
|
+
"""This service is not available.
|
|
383
|
+
:rtype: int
|
|
384
|
+
"""
|
|
385
|
+
return self._ReinforceHotword
|
|
386
|
+
|
|
387
|
+
@ReinforceHotword.setter
|
|
388
|
+
def ReinforceHotword(self, ReinforceHotword):
|
|
389
|
+
warnings.warn("parameter `ReinforceHotword` is deprecated", DeprecationWarning)
|
|
390
|
+
|
|
391
|
+
self._ReinforceHotword = ReinforceHotword
|
|
392
|
+
|
|
393
|
+
@property
|
|
394
|
+
def CustomizationId(self):
|
|
395
|
+
"""This service is not available.
|
|
396
|
+
:rtype: str
|
|
397
|
+
"""
|
|
398
|
+
return self._CustomizationId
|
|
399
|
+
|
|
400
|
+
@CustomizationId.setter
|
|
401
|
+
def CustomizationId(self, CustomizationId):
|
|
402
|
+
self._CustomizationId = CustomizationId
|
|
403
|
+
|
|
404
|
+
@property
|
|
405
|
+
def EmotionRecognition(self):
|
|
406
|
+
"""This service is not available.
|
|
407
|
+
:rtype: int
|
|
408
|
+
"""
|
|
409
|
+
return self._EmotionRecognition
|
|
410
|
+
|
|
411
|
+
@EmotionRecognition.setter
|
|
412
|
+
def EmotionRecognition(self, EmotionRecognition):
|
|
413
|
+
self._EmotionRecognition = EmotionRecognition
|
|
414
|
+
|
|
415
|
+
@property
|
|
416
|
+
def EmotionalEnergy(self):
|
|
417
|
+
"""Emotional energy value.
|
|
418
|
+
The value is the result of dividing the sound volume in dB by 10. Value range: [1,10]. The higher the value, the stronger the emotion.
|
|
419
|
+
0: Disable.
|
|
420
|
+
1: Enable.
|
|
421
|
+
The default value is 0.
|
|
422
|
+
:rtype: int
|
|
423
|
+
"""
|
|
424
|
+
return self._EmotionalEnergy
|
|
425
|
+
|
|
426
|
+
@EmotionalEnergy.setter
|
|
427
|
+
def EmotionalEnergy(self, EmotionalEnergy):
|
|
428
|
+
self._EmotionalEnergy = EmotionalEnergy
|
|
429
|
+
|
|
430
|
+
@property
|
|
431
|
+
def ConvertNumMode(self):
|
|
432
|
+
"""Intelligent conversion into Arabic numerals (supported only for engines for recognizing audio in Mandarin).
|
|
433
|
+
0: Do not convert, but directly output Chinese numerals.
|
|
434
|
+
1: Intelligently convert into Arabic numerals based on the scenario.
|
|
435
|
+
3: Enable conversion for math-related letters.
|
|
436
|
+
The default value is 1.
|
|
437
|
+
:rtype: int
|
|
438
|
+
"""
|
|
439
|
+
return self._ConvertNumMode
|
|
440
|
+
|
|
441
|
+
@ConvertNumMode.setter
|
|
442
|
+
def ConvertNumMode(self, ConvertNumMode):
|
|
443
|
+
self._ConvertNumMode = ConvertNumMode
|
|
444
|
+
|
|
445
|
+
@property
|
|
446
|
+
def FilterDirty(self):
|
|
447
|
+
"""Dirty word filtering (supported only for engines for recognizing audio in Mandarin).
|
|
448
|
+
0: Do not filter out dirty words.
|
|
449
|
+
1: Filter out dirty words.
|
|
450
|
+
2: Replace dirty words with *.
|
|
451
|
+
The default value is 0.
|
|
452
|
+
:rtype: int
|
|
453
|
+
"""
|
|
454
|
+
return self._FilterDirty
|
|
455
|
+
|
|
456
|
+
@FilterDirty.setter
|
|
457
|
+
def FilterDirty(self, FilterDirty):
|
|
458
|
+
self._FilterDirty = FilterDirty
|
|
459
|
+
|
|
460
|
+
@property
|
|
461
|
+
def FilterPunc(self):
|
|
462
|
+
"""Punctuation filtering (supported only for engines for recognizing audio in Mandarin).
|
|
463
|
+
0: Do not filter out punctuation.
|
|
464
|
+
1: Filter out sentence-ending punctuation.
|
|
465
|
+
2: Filter out all punctuation.
|
|
466
|
+
The default value is 0.
|
|
467
|
+
:rtype: int
|
|
468
|
+
"""
|
|
469
|
+
return self._FilterPunc
|
|
470
|
+
|
|
471
|
+
@FilterPunc.setter
|
|
472
|
+
def FilterPunc(self, FilterPunc):
|
|
473
|
+
self._FilterPunc = FilterPunc
|
|
474
|
+
|
|
475
|
+
@property
|
|
476
|
+
def FilterModal(self):
|
|
477
|
+
"""Modal particle filtering (supported only for engines for recognizing audio in Mandarin).
|
|
478
|
+
0: Do not filter out modal particles.
|
|
479
|
+
1: Filter out specified modal particles.
|
|
480
|
+
2: Filter out all modal particles.
|
|
481
|
+
The default value is 0.
|
|
482
|
+
:rtype: int
|
|
483
|
+
"""
|
|
484
|
+
return self._FilterModal
|
|
485
|
+
|
|
486
|
+
@FilterModal.setter
|
|
487
|
+
def FilterModal(self, FilterModal):
|
|
488
|
+
self._FilterModal = FilterModal
|
|
489
|
+
|
|
490
|
+
@property
|
|
491
|
+
def SentenceMaxLength(self):
|
|
492
|
+
"""The maximum number of characters per line (supported only for engines for recognizing audio in Mandarin). A punctuation mark is added if this limit is reached.
|
|
493
|
+
** This parameter can control the maximum number of characters per line, which applies to subtitle generation scenarios. ** Value range: [6,40].
|
|
494
|
+
0: Disable this feature.
|
|
495
|
+
The default value is 0.
|
|
496
|
+
|
|
497
|
+
Note: To enable this feature, ResTextFormat should be set to 3. The recognition result can be obtained from FinalSentence by parsing the list in the returned ResultDetail.
|
|
498
|
+
:rtype: int
|
|
499
|
+
"""
|
|
500
|
+
return self._SentenceMaxLength
|
|
501
|
+
|
|
502
|
+
@SentenceMaxLength.setter
|
|
503
|
+
def SentenceMaxLength(self, SentenceMaxLength):
|
|
504
|
+
self._SentenceMaxLength = SentenceMaxLength
|
|
505
|
+
|
|
506
|
+
@property
|
|
507
|
+
def Extra(self):
|
|
508
|
+
"""Additional parameter. ** (This parameter is meaningless. Ignore it.) **
|
|
509
|
+
:rtype: str
|
|
510
|
+
"""
|
|
511
|
+
return self._Extra
|
|
512
|
+
|
|
513
|
+
@Extra.setter
|
|
514
|
+
def Extra(self, Extra):
|
|
515
|
+
self._Extra = Extra
|
|
516
|
+
|
|
517
|
+
@property
|
|
518
|
+
def HotwordList(self):
|
|
519
|
+
"""Temporary term list. This parameter is used to improve the recognition accuracy.
|
|
520
|
+
|
|
521
|
+
- Restrictions for individual terms: The format is "term|weight". Each term can contain no more than 30 characters (or 10 Chinese characters. The weight can be in the range of [1-11] or 100. For example, "Tencent Cloud|5" or "ASR|11".
|
|
522
|
+
|
|
523
|
+
- Restrictions for the temporary term list: Multiple terms are separated by commas. The list can contain up to 128 terms. For example, "Tencent Cloud|10, Audio Recognition|5, ASR|11".
|
|
524
|
+
|
|
525
|
+
- Difference between hotword_id (term list) and hotword_list (temporary term list):
|
|
526
|
+
|
|
527
|
+
- hotword_id: Term list. You need to create a term list in the console or by using the API first and obtain the term list ID.
|
|
528
|
+
|
|
529
|
+
- hotword_list: Temporary term list. You can directly enter the ID of the temporary term list each time you initiate a request. The temporary term list is not retained on the cloud. This parameter applies to users with a massive number of terms.
|
|
530
|
+
|
|
531
|
+
Notes:
|
|
532
|
+
|
|
533
|
+
- If both hotword_id and hotword_list are specified, hotword_list will take effect first.
|
|
534
|
+
|
|
535
|
+
- When the weight of a term is set to 11, this term becomes a super term. It is recommended that the weight is set to 11 only for critical and necessary terms. The overall accuracy will be affected if the weight is set to 11 for too many terms.
|
|
536
|
+
|
|
537
|
+
- When the weight of a term is set to 100, the term enhancement feature is enabled to replace homophones of this term. (This feature is supported only for 8k_zh and 16k_zh engines.) For example, if you configure "mizhi 1|100", the recognized word "mizhi 2", which is a homophone of "mizhi 2", will be forcibly replaced with "mizhi 2". It is recommended that you enable this feature based on the actual needs. You can set the weight to 100 for only critical and necessary terms. The overall accuracy will be affected if the weight is set to 100 for too many terms.
|
|
538
|
+
:rtype: str
|
|
539
|
+
"""
|
|
540
|
+
return self._HotwordList
|
|
541
|
+
|
|
542
|
+
@HotwordList.setter
|
|
543
|
+
def HotwordList(self, HotwordList):
|
|
544
|
+
self._HotwordList = HotwordList
|
|
545
|
+
|
|
546
|
+
@property
|
|
547
|
+
def KeyWordLibIdList(self):
|
|
548
|
+
"""List of keyword IDs for recognition. This parameter is left blank by default, indicating that no keyword is recognized. You can enter up to 10 IDs.
|
|
549
|
+
|
|
550
|
+
:rtype: list of str
|
|
551
|
+
"""
|
|
552
|
+
return self._KeyWordLibIdList
|
|
553
|
+
|
|
554
|
+
@KeyWordLibIdList.setter
|
|
555
|
+
def KeyWordLibIdList(self, KeyWordLibIdList):
|
|
556
|
+
self._KeyWordLibIdList = KeyWordLibIdList
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
def _deserialize(self, params):
|
|
560
|
+
self._EngineModelType = params.get("EngineModelType")
|
|
561
|
+
self._ChannelNum = params.get("ChannelNum")
|
|
562
|
+
self._ResTextFormat = params.get("ResTextFormat")
|
|
563
|
+
self._SourceType = params.get("SourceType")
|
|
564
|
+
self._Data = params.get("Data")
|
|
565
|
+
self._DataLen = params.get("DataLen")
|
|
566
|
+
self._Url = params.get("Url")
|
|
567
|
+
self._CallbackUrl = params.get("CallbackUrl")
|
|
568
|
+
self._SpeakerDiarization = params.get("SpeakerDiarization")
|
|
569
|
+
self._SpeakerNumber = params.get("SpeakerNumber")
|
|
570
|
+
self._HotwordId = params.get("HotwordId")
|
|
571
|
+
self._ReinforceHotword = params.get("ReinforceHotword")
|
|
572
|
+
self._CustomizationId = params.get("CustomizationId")
|
|
573
|
+
self._EmotionRecognition = params.get("EmotionRecognition")
|
|
574
|
+
self._EmotionalEnergy = params.get("EmotionalEnergy")
|
|
575
|
+
self._ConvertNumMode = params.get("ConvertNumMode")
|
|
576
|
+
self._FilterDirty = params.get("FilterDirty")
|
|
577
|
+
self._FilterPunc = params.get("FilterPunc")
|
|
578
|
+
self._FilterModal = params.get("FilterModal")
|
|
579
|
+
self._SentenceMaxLength = params.get("SentenceMaxLength")
|
|
580
|
+
self._Extra = params.get("Extra")
|
|
581
|
+
self._HotwordList = params.get("HotwordList")
|
|
582
|
+
self._KeyWordLibIdList = params.get("KeyWordLibIdList")
|
|
583
|
+
memeber_set = set(params.keys())
|
|
584
|
+
for name, value in vars(self).items():
|
|
585
|
+
property_name = name[1:]
|
|
586
|
+
if property_name in memeber_set:
|
|
587
|
+
memeber_set.remove(property_name)
|
|
588
|
+
if len(memeber_set) > 0:
|
|
589
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
class CreateRecTaskResponse(AbstractModel):
|
|
594
|
+
"""CreateRecTask response structure.
|
|
595
|
+
|
|
596
|
+
"""
|
|
597
|
+
|
|
598
|
+
def __init__(self):
|
|
599
|
+
r"""
|
|
600
|
+
:param _Data: Returned result of the recording recognition request, containing the task ID required for querying the result.
|
|
601
|
+
** Note: The task ID is valid for 24 hours, and duplicate task IDs of different dates may exist. Do not use task ID as the unique ID in your business system. **
|
|
602
|
+
|
|
603
|
+
:type Data: :class:`tencentcloud.asr.v20190614.models.Task`
|
|
604
|
+
:param _RequestId: The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
|
|
605
|
+
:type RequestId: str
|
|
606
|
+
"""
|
|
607
|
+
self._Data = None
|
|
608
|
+
self._RequestId = None
|
|
609
|
+
|
|
610
|
+
@property
|
|
611
|
+
def Data(self):
|
|
612
|
+
"""Returned result of the recording recognition request, containing the task ID required for querying the result.
|
|
613
|
+
** Note: The task ID is valid for 24 hours, and duplicate task IDs of different dates may exist. Do not use task ID as the unique ID in your business system. **
|
|
614
|
+
|
|
615
|
+
:rtype: :class:`tencentcloud.asr.v20190614.models.Task`
|
|
616
|
+
"""
|
|
617
|
+
return self._Data
|
|
618
|
+
|
|
619
|
+
@Data.setter
|
|
620
|
+
def Data(self, Data):
|
|
621
|
+
self._Data = Data
|
|
622
|
+
|
|
623
|
+
@property
|
|
624
|
+
def RequestId(self):
|
|
625
|
+
"""The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
|
|
626
|
+
:rtype: str
|
|
627
|
+
"""
|
|
628
|
+
return self._RequestId
|
|
629
|
+
|
|
630
|
+
@RequestId.setter
|
|
631
|
+
def RequestId(self, RequestId):
|
|
632
|
+
self._RequestId = RequestId
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
def _deserialize(self, params):
|
|
636
|
+
if params.get("Data") is not None:
|
|
637
|
+
self._Data = Task()
|
|
638
|
+
self._Data._deserialize(params.get("Data"))
|
|
639
|
+
self._RequestId = params.get("RequestId")
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
class DescribeTaskStatusRequest(AbstractModel):
|
|
643
|
+
"""DescribeTaskStatus request structure.
|
|
644
|
+
|
|
645
|
+
"""
|
|
646
|
+
|
|
647
|
+
def __init__(self):
|
|
648
|
+
r"""
|
|
649
|
+
:param _TaskId: Task ID obtained from the CreateRecTask API, which is used to obtain the task status and results.
|
|
650
|
+
** Note: A task is valid for 24 hours. Do not query the results with the tasks that have existed for more than 24 hours. **
|
|
651
|
+
:type TaskId: int
|
|
652
|
+
"""
|
|
653
|
+
self._TaskId = None
|
|
654
|
+
|
|
655
|
+
@property
|
|
656
|
+
def TaskId(self):
|
|
657
|
+
"""Task ID obtained from the CreateRecTask API, which is used to obtain the task status and results.
|
|
658
|
+
** Note: A task is valid for 24 hours. Do not query the results with the tasks that have existed for more than 24 hours. **
|
|
659
|
+
:rtype: int
|
|
660
|
+
"""
|
|
661
|
+
return self._TaskId
|
|
662
|
+
|
|
663
|
+
@TaskId.setter
|
|
664
|
+
def TaskId(self, TaskId):
|
|
665
|
+
self._TaskId = TaskId
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
def _deserialize(self, params):
|
|
669
|
+
self._TaskId = params.get("TaskId")
|
|
670
|
+
memeber_set = set(params.keys())
|
|
671
|
+
for name, value in vars(self).items():
|
|
672
|
+
property_name = name[1:]
|
|
673
|
+
if property_name in memeber_set:
|
|
674
|
+
memeber_set.remove(property_name)
|
|
675
|
+
if len(memeber_set) > 0:
|
|
676
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
class DescribeTaskStatusResponse(AbstractModel):
|
|
681
|
+
"""DescribeTaskStatus response structure.
|
|
682
|
+
|
|
683
|
+
"""
|
|
684
|
+
|
|
685
|
+
def __init__(self):
|
|
686
|
+
r"""
|
|
687
|
+
:param _Data: Returned result of the recording recognition request.
|
|
688
|
+
:type Data: :class:`tencentcloud.asr.v20190614.models.TaskStatus`
|
|
689
|
+
:param _RequestId: The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
|
|
690
|
+
:type RequestId: str
|
|
691
|
+
"""
|
|
692
|
+
self._Data = None
|
|
693
|
+
self._RequestId = None
|
|
694
|
+
|
|
695
|
+
@property
|
|
696
|
+
def Data(self):
|
|
697
|
+
"""Returned result of the recording recognition request.
|
|
698
|
+
:rtype: :class:`tencentcloud.asr.v20190614.models.TaskStatus`
|
|
699
|
+
"""
|
|
700
|
+
return self._Data
|
|
701
|
+
|
|
702
|
+
@Data.setter
|
|
703
|
+
def Data(self, Data):
|
|
704
|
+
self._Data = Data
|
|
705
|
+
|
|
706
|
+
@property
|
|
707
|
+
def RequestId(self):
|
|
708
|
+
"""The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
|
|
709
|
+
:rtype: str
|
|
710
|
+
"""
|
|
711
|
+
return self._RequestId
|
|
712
|
+
|
|
713
|
+
@RequestId.setter
|
|
714
|
+
def RequestId(self, RequestId):
|
|
715
|
+
self._RequestId = RequestId
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
def _deserialize(self, params):
|
|
719
|
+
if params.get("Data") is not None:
|
|
720
|
+
self._Data = TaskStatus()
|
|
721
|
+
self._Data._deserialize(params.get("Data"))
|
|
722
|
+
self._RequestId = params.get("RequestId")
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
class KeyWordResult(AbstractModel):
|
|
726
|
+
"""Keyword recognition result.
|
|
727
|
+
|
|
728
|
+
"""
|
|
729
|
+
|
|
730
|
+
def __init__(self):
|
|
731
|
+
r"""
|
|
732
|
+
:param _KeyWordLibID: Keyword library ID.
|
|
733
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
734
|
+
:type KeyWordLibID: str
|
|
735
|
+
:param _KeyWordLibName: Keyword library name.
|
|
736
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
737
|
+
:type KeyWordLibName: str
|
|
738
|
+
:param _KeyWords: Matching keywords.
|
|
739
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
740
|
+
:type KeyWords: list of str
|
|
741
|
+
"""
|
|
742
|
+
self._KeyWordLibID = None
|
|
743
|
+
self._KeyWordLibName = None
|
|
744
|
+
self._KeyWords = None
|
|
745
|
+
|
|
746
|
+
@property
|
|
747
|
+
def KeyWordLibID(self):
|
|
748
|
+
"""Keyword library ID.
|
|
749
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
750
|
+
:rtype: str
|
|
751
|
+
"""
|
|
752
|
+
return self._KeyWordLibID
|
|
753
|
+
|
|
754
|
+
@KeyWordLibID.setter
|
|
755
|
+
def KeyWordLibID(self, KeyWordLibID):
|
|
756
|
+
self._KeyWordLibID = KeyWordLibID
|
|
757
|
+
|
|
758
|
+
@property
|
|
759
|
+
def KeyWordLibName(self):
|
|
760
|
+
"""Keyword library name.
|
|
761
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
762
|
+
:rtype: str
|
|
763
|
+
"""
|
|
764
|
+
return self._KeyWordLibName
|
|
765
|
+
|
|
766
|
+
@KeyWordLibName.setter
|
|
767
|
+
def KeyWordLibName(self, KeyWordLibName):
|
|
768
|
+
self._KeyWordLibName = KeyWordLibName
|
|
769
|
+
|
|
770
|
+
@property
|
|
771
|
+
def KeyWords(self):
|
|
772
|
+
"""Matching keywords.
|
|
773
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
774
|
+
:rtype: list of str
|
|
775
|
+
"""
|
|
776
|
+
return self._KeyWords
|
|
777
|
+
|
|
778
|
+
@KeyWords.setter
|
|
779
|
+
def KeyWords(self, KeyWords):
|
|
780
|
+
self._KeyWords = KeyWords
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
def _deserialize(self, params):
|
|
784
|
+
self._KeyWordLibID = params.get("KeyWordLibID")
|
|
785
|
+
self._KeyWordLibName = params.get("KeyWordLibName")
|
|
786
|
+
self._KeyWords = params.get("KeyWords")
|
|
787
|
+
memeber_set = set(params.keys())
|
|
788
|
+
for name, value in vars(self).items():
|
|
789
|
+
property_name = name[1:]
|
|
790
|
+
if property_name in memeber_set:
|
|
791
|
+
memeber_set.remove(property_name)
|
|
792
|
+
if len(memeber_set) > 0:
|
|
793
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
class SentenceDetail(AbstractModel):
|
|
798
|
+
"""Detailed recognition result of a sentence, including the time offset of individual words. This parameter generally applies to subtitle generation scenarios.
|
|
799
|
+
|
|
800
|
+
"""
|
|
801
|
+
|
|
802
|
+
def __init__(self):
|
|
803
|
+
r"""
|
|
804
|
+
:param _FinalSentence: Final recognition result of a sentence.
|
|
805
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
806
|
+
:type FinalSentence: str
|
|
807
|
+
:param _SliceSentence: Intermediate recognition result of a sentence. The sentence is split into multiple phrases by spaces.
|
|
808
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
809
|
+
:type SliceSentence: str
|
|
810
|
+
:param _WrittenText: Oral-to-written transcription result. This parameter has a value only if the corresponding feature is enabled.
|
|
811
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
812
|
+
:type WrittenText: str
|
|
813
|
+
:param _StartMs: Start time of a sentence (ms).
|
|
814
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
815
|
+
:type StartMs: int
|
|
816
|
+
:param _EndMs: End time of a sentence (ms).
|
|
817
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
818
|
+
:type EndMs: int
|
|
819
|
+
:param _WordsNum: Number of words in a sentence.
|
|
820
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
821
|
+
:type WordsNum: int
|
|
822
|
+
:param _Words: Word details of a sentence.
|
|
823
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
824
|
+
:type Words: list of SentenceWords
|
|
825
|
+
:param _SpeechSpeed: Speech speed of a sentence. Unit: Number of words per second.
|
|
826
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
827
|
+
:type SpeechSpeed: float
|
|
828
|
+
:param _SpeakerId: Channel or speaker ID. (If speaker_diarization is specified or ChannelNum is set to 2 (stereo) in the request, speakers or channels can be distinguished.)
|
|
829
|
+
Different values represent different speakers in mono mode. For the speakerId values, 0 represents the left channel, and 1 represents the right channel in stereo mode if an 8k engine is used.
|
|
830
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
831
|
+
:type SpeakerId: int
|
|
832
|
+
:param _EmotionalEnergy: Emotional energy value. This value is the result of dividing the sound volume in dB by 10. Value range: [1,10]. The higher the value, the stronger the emotion.
|
|
833
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
834
|
+
:type EmotionalEnergy: float
|
|
835
|
+
:param _SilenceTime: Silent duration between the current sentence and the last sentence.
|
|
836
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
837
|
+
:type SilenceTime: int
|
|
838
|
+
:param _EmotionType: Emotion type. (This parameter may be left blank in two scenarios: 1. No corresponding resource package exists; 2. The emotion is not recognized because it is not strong enough, which is related to the emotional energy.)
|
|
839
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
840
|
+
:type EmotionType: list of str
|
|
841
|
+
:param _KeyWordResults: List of recognized keywords.
|
|
842
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
843
|
+
:type KeyWordResults: list of KeyWordResult
|
|
844
|
+
"""
|
|
845
|
+
self._FinalSentence = None
|
|
846
|
+
self._SliceSentence = None
|
|
847
|
+
self._WrittenText = None
|
|
848
|
+
self._StartMs = None
|
|
849
|
+
self._EndMs = None
|
|
850
|
+
self._WordsNum = None
|
|
851
|
+
self._Words = None
|
|
852
|
+
self._SpeechSpeed = None
|
|
853
|
+
self._SpeakerId = None
|
|
854
|
+
self._EmotionalEnergy = None
|
|
855
|
+
self._SilenceTime = None
|
|
856
|
+
self._EmotionType = None
|
|
857
|
+
self._KeyWordResults = None
|
|
858
|
+
|
|
859
|
+
@property
|
|
860
|
+
def FinalSentence(self):
|
|
861
|
+
"""Final recognition result of a sentence.
|
|
862
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
863
|
+
:rtype: str
|
|
864
|
+
"""
|
|
865
|
+
return self._FinalSentence
|
|
866
|
+
|
|
867
|
+
@FinalSentence.setter
|
|
868
|
+
def FinalSentence(self, FinalSentence):
|
|
869
|
+
self._FinalSentence = FinalSentence
|
|
870
|
+
|
|
871
|
+
@property
|
|
872
|
+
def SliceSentence(self):
|
|
873
|
+
"""Intermediate recognition result of a sentence. The sentence is split into multiple phrases by spaces.
|
|
874
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
875
|
+
:rtype: str
|
|
876
|
+
"""
|
|
877
|
+
return self._SliceSentence
|
|
878
|
+
|
|
879
|
+
@SliceSentence.setter
|
|
880
|
+
def SliceSentence(self, SliceSentence):
|
|
881
|
+
self._SliceSentence = SliceSentence
|
|
882
|
+
|
|
883
|
+
@property
|
|
884
|
+
def WrittenText(self):
|
|
885
|
+
"""Oral-to-written transcription result. This parameter has a value only if the corresponding feature is enabled.
|
|
886
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
887
|
+
:rtype: str
|
|
888
|
+
"""
|
|
889
|
+
return self._WrittenText
|
|
890
|
+
|
|
891
|
+
@WrittenText.setter
|
|
892
|
+
def WrittenText(self, WrittenText):
|
|
893
|
+
self._WrittenText = WrittenText
|
|
894
|
+
|
|
895
|
+
@property
|
|
896
|
+
def StartMs(self):
|
|
897
|
+
"""Start time of a sentence (ms).
|
|
898
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
899
|
+
:rtype: int
|
|
900
|
+
"""
|
|
901
|
+
return self._StartMs
|
|
902
|
+
|
|
903
|
+
@StartMs.setter
|
|
904
|
+
def StartMs(self, StartMs):
|
|
905
|
+
self._StartMs = StartMs
|
|
906
|
+
|
|
907
|
+
@property
|
|
908
|
+
def EndMs(self):
|
|
909
|
+
"""End time of a sentence (ms).
|
|
910
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
911
|
+
:rtype: int
|
|
912
|
+
"""
|
|
913
|
+
return self._EndMs
|
|
914
|
+
|
|
915
|
+
@EndMs.setter
|
|
916
|
+
def EndMs(self, EndMs):
|
|
917
|
+
self._EndMs = EndMs
|
|
918
|
+
|
|
919
|
+
@property
|
|
920
|
+
def WordsNum(self):
|
|
921
|
+
"""Number of words in a sentence.
|
|
922
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
923
|
+
:rtype: int
|
|
924
|
+
"""
|
|
925
|
+
return self._WordsNum
|
|
926
|
+
|
|
927
|
+
@WordsNum.setter
|
|
928
|
+
def WordsNum(self, WordsNum):
|
|
929
|
+
self._WordsNum = WordsNum
|
|
930
|
+
|
|
931
|
+
@property
|
|
932
|
+
def Words(self):
|
|
933
|
+
"""Word details of a sentence.
|
|
934
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
935
|
+
:rtype: list of SentenceWords
|
|
936
|
+
"""
|
|
937
|
+
return self._Words
|
|
938
|
+
|
|
939
|
+
@Words.setter
|
|
940
|
+
def Words(self, Words):
|
|
941
|
+
self._Words = Words
|
|
942
|
+
|
|
943
|
+
@property
|
|
944
|
+
def SpeechSpeed(self):
|
|
945
|
+
"""Speech speed of a sentence. Unit: Number of words per second.
|
|
946
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
947
|
+
:rtype: float
|
|
948
|
+
"""
|
|
949
|
+
return self._SpeechSpeed
|
|
950
|
+
|
|
951
|
+
@SpeechSpeed.setter
|
|
952
|
+
def SpeechSpeed(self, SpeechSpeed):
|
|
953
|
+
self._SpeechSpeed = SpeechSpeed
|
|
954
|
+
|
|
955
|
+
@property
|
|
956
|
+
def SpeakerId(self):
|
|
957
|
+
"""Channel or speaker ID. (If speaker_diarization is specified or ChannelNum is set to 2 (stereo) in the request, speakers or channels can be distinguished.)
|
|
958
|
+
Different values represent different speakers in mono mode. For the speakerId values, 0 represents the left channel, and 1 represents the right channel in stereo mode if an 8k engine is used.
|
|
959
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
960
|
+
:rtype: int
|
|
961
|
+
"""
|
|
962
|
+
return self._SpeakerId
|
|
963
|
+
|
|
964
|
+
@SpeakerId.setter
|
|
965
|
+
def SpeakerId(self, SpeakerId):
|
|
966
|
+
self._SpeakerId = SpeakerId
|
|
967
|
+
|
|
968
|
+
@property
|
|
969
|
+
def EmotionalEnergy(self):
|
|
970
|
+
"""Emotional energy value. This value is the result of dividing the sound volume in dB by 10. Value range: [1,10]. The higher the value, the stronger the emotion.
|
|
971
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
972
|
+
:rtype: float
|
|
973
|
+
"""
|
|
974
|
+
return self._EmotionalEnergy
|
|
975
|
+
|
|
976
|
+
@EmotionalEnergy.setter
|
|
977
|
+
def EmotionalEnergy(self, EmotionalEnergy):
|
|
978
|
+
self._EmotionalEnergy = EmotionalEnergy
|
|
979
|
+
|
|
980
|
+
@property
|
|
981
|
+
def SilenceTime(self):
|
|
982
|
+
"""Silent duration between the current sentence and the last sentence.
|
|
983
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
984
|
+
:rtype: int
|
|
985
|
+
"""
|
|
986
|
+
return self._SilenceTime
|
|
987
|
+
|
|
988
|
+
@SilenceTime.setter
|
|
989
|
+
def SilenceTime(self, SilenceTime):
|
|
990
|
+
self._SilenceTime = SilenceTime
|
|
991
|
+
|
|
992
|
+
@property
|
|
993
|
+
def EmotionType(self):
|
|
994
|
+
"""Emotion type. (This parameter may be left blank in two scenarios: 1. No corresponding resource package exists; 2. The emotion is not recognized because it is not strong enough, which is related to the emotional energy.)
|
|
995
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
996
|
+
:rtype: list of str
|
|
997
|
+
"""
|
|
998
|
+
return self._EmotionType
|
|
999
|
+
|
|
1000
|
+
@EmotionType.setter
|
|
1001
|
+
def EmotionType(self, EmotionType):
|
|
1002
|
+
self._EmotionType = EmotionType
|
|
1003
|
+
|
|
1004
|
+
@property
|
|
1005
|
+
def KeyWordResults(self):
|
|
1006
|
+
"""List of recognized keywords.
|
|
1007
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1008
|
+
:rtype: list of KeyWordResult
|
|
1009
|
+
"""
|
|
1010
|
+
return self._KeyWordResults
|
|
1011
|
+
|
|
1012
|
+
@KeyWordResults.setter
|
|
1013
|
+
def KeyWordResults(self, KeyWordResults):
|
|
1014
|
+
self._KeyWordResults = KeyWordResults
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
def _deserialize(self, params):
|
|
1018
|
+
self._FinalSentence = params.get("FinalSentence")
|
|
1019
|
+
self._SliceSentence = params.get("SliceSentence")
|
|
1020
|
+
self._WrittenText = params.get("WrittenText")
|
|
1021
|
+
self._StartMs = params.get("StartMs")
|
|
1022
|
+
self._EndMs = params.get("EndMs")
|
|
1023
|
+
self._WordsNum = params.get("WordsNum")
|
|
1024
|
+
if params.get("Words") is not None:
|
|
1025
|
+
self._Words = []
|
|
1026
|
+
for item in params.get("Words"):
|
|
1027
|
+
obj = SentenceWords()
|
|
1028
|
+
obj._deserialize(item)
|
|
1029
|
+
self._Words.append(obj)
|
|
1030
|
+
self._SpeechSpeed = params.get("SpeechSpeed")
|
|
1031
|
+
self._SpeakerId = params.get("SpeakerId")
|
|
1032
|
+
self._EmotionalEnergy = params.get("EmotionalEnergy")
|
|
1033
|
+
self._SilenceTime = params.get("SilenceTime")
|
|
1034
|
+
self._EmotionType = params.get("EmotionType")
|
|
1035
|
+
if params.get("KeyWordResults") is not None:
|
|
1036
|
+
self._KeyWordResults = []
|
|
1037
|
+
for item in params.get("KeyWordResults"):
|
|
1038
|
+
obj = KeyWordResult()
|
|
1039
|
+
obj._deserialize(item)
|
|
1040
|
+
self._KeyWordResults.append(obj)
|
|
1041
|
+
memeber_set = set(params.keys())
|
|
1042
|
+
for name, value in vars(self).items():
|
|
1043
|
+
property_name = name[1:]
|
|
1044
|
+
if property_name in memeber_set:
|
|
1045
|
+
memeber_set.remove(property_name)
|
|
1046
|
+
if len(memeber_set) > 0:
|
|
1047
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
class SentenceWords(AbstractModel):
|
|
1052
|
+
"""Word text in the recognition result and the corresponding time offset.
|
|
1053
|
+
|
|
1054
|
+
"""
|
|
1055
|
+
|
|
1056
|
+
def __init__(self):
|
|
1057
|
+
r"""
|
|
1058
|
+
:param _Word: Word text.
|
|
1059
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1060
|
+
:type Word: str
|
|
1061
|
+
:param _OffsetStartMs: Start time offset in the sentence.
|
|
1062
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1063
|
+
:type OffsetStartMs: int
|
|
1064
|
+
:param _OffsetEndMs: End time offset in the sentence.
|
|
1065
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1066
|
+
:type OffsetEndMs: int
|
|
1067
|
+
"""
|
|
1068
|
+
self._Word = None
|
|
1069
|
+
self._OffsetStartMs = None
|
|
1070
|
+
self._OffsetEndMs = None
|
|
1071
|
+
|
|
1072
|
+
@property
|
|
1073
|
+
def Word(self):
|
|
1074
|
+
"""Word text.
|
|
1075
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1076
|
+
:rtype: str
|
|
1077
|
+
"""
|
|
1078
|
+
return self._Word
|
|
1079
|
+
|
|
1080
|
+
@Word.setter
|
|
1081
|
+
def Word(self, Word):
|
|
1082
|
+
self._Word = Word
|
|
1083
|
+
|
|
1084
|
+
@property
|
|
1085
|
+
def OffsetStartMs(self):
|
|
1086
|
+
"""Start time offset in the sentence.
|
|
1087
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1088
|
+
:rtype: int
|
|
1089
|
+
"""
|
|
1090
|
+
return self._OffsetStartMs
|
|
1091
|
+
|
|
1092
|
+
@OffsetStartMs.setter
|
|
1093
|
+
def OffsetStartMs(self, OffsetStartMs):
|
|
1094
|
+
self._OffsetStartMs = OffsetStartMs
|
|
1095
|
+
|
|
1096
|
+
@property
|
|
1097
|
+
def OffsetEndMs(self):
|
|
1098
|
+
"""End time offset in the sentence.
|
|
1099
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1100
|
+
:rtype: int
|
|
1101
|
+
"""
|
|
1102
|
+
return self._OffsetEndMs
|
|
1103
|
+
|
|
1104
|
+
@OffsetEndMs.setter
|
|
1105
|
+
def OffsetEndMs(self, OffsetEndMs):
|
|
1106
|
+
self._OffsetEndMs = OffsetEndMs
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
def _deserialize(self, params):
|
|
1110
|
+
self._Word = params.get("Word")
|
|
1111
|
+
self._OffsetStartMs = params.get("OffsetStartMs")
|
|
1112
|
+
self._OffsetEndMs = params.get("OffsetEndMs")
|
|
1113
|
+
memeber_set = set(params.keys())
|
|
1114
|
+
for name, value in vars(self).items():
|
|
1115
|
+
property_name = name[1:]
|
|
1116
|
+
if property_name in memeber_set:
|
|
1117
|
+
memeber_set.remove(property_name)
|
|
1118
|
+
if len(memeber_set) > 0:
|
|
1119
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
class Task(AbstractModel):
|
|
1124
|
+
"""Returned data of the [recording recognition] (https://intl.cloud.tencent.com/document/product/1093/37823?from_cn_redirect=1#3.-.E8.BE.93.E5.87.BA.E5.8F.82.E6.95.B0) or [asynchronous real-time audio recognition] (https://intl.cloud.tencent.com/document/product/1093/52061?from_cn_redirect=1#3.-.E8.BE.93.E5.87.BA.E5.8F.82.E6.95.B0) request.
|
|
1125
|
+
|
|
1126
|
+
"""
|
|
1127
|
+
|
|
1128
|
+
def __init__(self):
|
|
1129
|
+
r"""
|
|
1130
|
+
:param _TaskId: Task ID. This ID can be used to obtain the recognition status and results through polling. The data type of TaskId is ** uint64 **.
|
|
1131
|
+
** Note: The task ID is valid for 24 hours, and duplicate task IDs of different dates may exist. Do not use task ID as the unique ID in your business system. **
|
|
1132
|
+
:type TaskId: int
|
|
1133
|
+
"""
|
|
1134
|
+
self._TaskId = None
|
|
1135
|
+
|
|
1136
|
+
@property
|
|
1137
|
+
def TaskId(self):
|
|
1138
|
+
"""Task ID. This ID can be used to obtain the recognition status and results through polling. The data type of TaskId is ** uint64 **.
|
|
1139
|
+
** Note: The task ID is valid for 24 hours, and duplicate task IDs of different dates may exist. Do not use task ID as the unique ID in your business system. **
|
|
1140
|
+
:rtype: int
|
|
1141
|
+
"""
|
|
1142
|
+
return self._TaskId
|
|
1143
|
+
|
|
1144
|
+
@TaskId.setter
|
|
1145
|
+
def TaskId(self, TaskId):
|
|
1146
|
+
self._TaskId = TaskId
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
def _deserialize(self, params):
|
|
1150
|
+
self._TaskId = params.get("TaskId")
|
|
1151
|
+
memeber_set = set(params.keys())
|
|
1152
|
+
for name, value in vars(self).items():
|
|
1153
|
+
property_name = name[1:]
|
|
1154
|
+
if property_name in memeber_set:
|
|
1155
|
+
memeber_set.remove(property_name)
|
|
1156
|
+
if len(memeber_set) > 0:
|
|
1157
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
class TaskStatus(AbstractModel):
|
|
1162
|
+
"""[Response parameters for obtaining recording recognition results] (https://intl.cloud.tencent.com/document/product/1093/37822?from_cn_redirect=1#3.-.E8.BE.93.E5.87.BA.E5.8F.82.E6.95.B0)
|
|
1163
|
+
|
|
1164
|
+
"""
|
|
1165
|
+
|
|
1166
|
+
def __init__(self):
|
|
1167
|
+
r"""
|
|
1168
|
+
:param _TaskId: Task ID. Note: The data type of TaskId is uint64.
|
|
1169
|
+
:type TaskId: int
|
|
1170
|
+
:param _Status: Task status code. 0: waiting; 1: in process; 2: success; 3: failed.
|
|
1171
|
+
:type Status: int
|
|
1172
|
+
:param _StatusStr: Task status. Valid values: waiting, in process, success, and failed.
|
|
1173
|
+
:type StatusStr: str
|
|
1174
|
+
:param _Result: Recognition result.
|
|
1175
|
+
:type Result: str
|
|
1176
|
+
:param _ErrorMsg: Failure cause.
|
|
1177
|
+
:type ErrorMsg: str
|
|
1178
|
+
:param _ResultDetail: Recognition result details, including word time offsets for each sentence, which is generally used in subtitle generation scenarios. (This field is not left blank when ResTextFormat in the recording recognition request is set to 1.)
|
|
1179
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1180
|
+
:type ResultDetail: list of SentenceDetail
|
|
1181
|
+
:param _AudioDuration: Audio duration (seconds).
|
|
1182
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1183
|
+
:type AudioDuration: float
|
|
1184
|
+
"""
|
|
1185
|
+
self._TaskId = None
|
|
1186
|
+
self._Status = None
|
|
1187
|
+
self._StatusStr = None
|
|
1188
|
+
self._Result = None
|
|
1189
|
+
self._ErrorMsg = None
|
|
1190
|
+
self._ResultDetail = None
|
|
1191
|
+
self._AudioDuration = None
|
|
1192
|
+
|
|
1193
|
+
@property
|
|
1194
|
+
def TaskId(self):
|
|
1195
|
+
"""Task ID. Note: The data type of TaskId is uint64.
|
|
1196
|
+
:rtype: int
|
|
1197
|
+
"""
|
|
1198
|
+
return self._TaskId
|
|
1199
|
+
|
|
1200
|
+
@TaskId.setter
|
|
1201
|
+
def TaskId(self, TaskId):
|
|
1202
|
+
self._TaskId = TaskId
|
|
1203
|
+
|
|
1204
|
+
@property
|
|
1205
|
+
def Status(self):
|
|
1206
|
+
"""Task status code. 0: waiting; 1: in process; 2: success; 3: failed.
|
|
1207
|
+
:rtype: int
|
|
1208
|
+
"""
|
|
1209
|
+
return self._Status
|
|
1210
|
+
|
|
1211
|
+
@Status.setter
|
|
1212
|
+
def Status(self, Status):
|
|
1213
|
+
self._Status = Status
|
|
1214
|
+
|
|
1215
|
+
@property
|
|
1216
|
+
def StatusStr(self):
|
|
1217
|
+
"""Task status. Valid values: waiting, in process, success, and failed.
|
|
1218
|
+
:rtype: str
|
|
1219
|
+
"""
|
|
1220
|
+
return self._StatusStr
|
|
1221
|
+
|
|
1222
|
+
@StatusStr.setter
|
|
1223
|
+
def StatusStr(self, StatusStr):
|
|
1224
|
+
self._StatusStr = StatusStr
|
|
1225
|
+
|
|
1226
|
+
@property
|
|
1227
|
+
def Result(self):
|
|
1228
|
+
"""Recognition result.
|
|
1229
|
+
:rtype: str
|
|
1230
|
+
"""
|
|
1231
|
+
return self._Result
|
|
1232
|
+
|
|
1233
|
+
@Result.setter
|
|
1234
|
+
def Result(self, Result):
|
|
1235
|
+
self._Result = Result
|
|
1236
|
+
|
|
1237
|
+
@property
|
|
1238
|
+
def ErrorMsg(self):
|
|
1239
|
+
"""Failure cause.
|
|
1240
|
+
:rtype: str
|
|
1241
|
+
"""
|
|
1242
|
+
return self._ErrorMsg
|
|
1243
|
+
|
|
1244
|
+
@ErrorMsg.setter
|
|
1245
|
+
def ErrorMsg(self, ErrorMsg):
|
|
1246
|
+
self._ErrorMsg = ErrorMsg
|
|
1247
|
+
|
|
1248
|
+
@property
|
|
1249
|
+
def ResultDetail(self):
|
|
1250
|
+
"""Recognition result details, including word time offsets for each sentence, which is generally used in subtitle generation scenarios. (This field is not left blank when ResTextFormat in the recording recognition request is set to 1.)
|
|
1251
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1252
|
+
:rtype: list of SentenceDetail
|
|
1253
|
+
"""
|
|
1254
|
+
return self._ResultDetail
|
|
1255
|
+
|
|
1256
|
+
@ResultDetail.setter
|
|
1257
|
+
def ResultDetail(self, ResultDetail):
|
|
1258
|
+
self._ResultDetail = ResultDetail
|
|
1259
|
+
|
|
1260
|
+
@property
|
|
1261
|
+
def AudioDuration(self):
|
|
1262
|
+
"""Audio duration (seconds).
|
|
1263
|
+
Note: This field may return null, indicating that no valid values can be obtained.
|
|
1264
|
+
:rtype: float
|
|
1265
|
+
"""
|
|
1266
|
+
return self._AudioDuration
|
|
1267
|
+
|
|
1268
|
+
@AudioDuration.setter
|
|
1269
|
+
def AudioDuration(self, AudioDuration):
|
|
1270
|
+
self._AudioDuration = AudioDuration
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
def _deserialize(self, params):
|
|
1274
|
+
self._TaskId = params.get("TaskId")
|
|
1275
|
+
self._Status = params.get("Status")
|
|
1276
|
+
self._StatusStr = params.get("StatusStr")
|
|
1277
|
+
self._Result = params.get("Result")
|
|
1278
|
+
self._ErrorMsg = params.get("ErrorMsg")
|
|
1279
|
+
if params.get("ResultDetail") is not None:
|
|
1280
|
+
self._ResultDetail = []
|
|
1281
|
+
for item in params.get("ResultDetail"):
|
|
1282
|
+
obj = SentenceDetail()
|
|
1283
|
+
obj._deserialize(item)
|
|
1284
|
+
self._ResultDetail.append(obj)
|
|
1285
|
+
self._AudioDuration = params.get("AudioDuration")
|
|
1286
|
+
memeber_set = set(params.keys())
|
|
1287
|
+
for name, value in vars(self).items():
|
|
1288
|
+
property_name = name[1:]
|
|
1289
|
+
if property_name in memeber_set:
|
|
1290
|
+
memeber_set.remove(property_name)
|
|
1291
|
+
if len(memeber_set) > 0:
|
|
1292
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
1293
|
+
|