Skip to content

Commit 482ccd6

Browse files
committed
feat(speech to text): ProcessingMetrics has processing_metrics field
1 parent 306e42a commit 482ccd6

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

ibm_watson/speech_to_text_v1.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4968,7 +4968,8 @@ def __ne__(self, other):
49684968
class ProcessingMetrics(object):
49694969
"""
49704970
If processing metrics are requested, information about the service's processing of the
4971-
input audio.
4971+
input audio. Processing metrics are not available with the synchronous **Recognize
4972+
audio** method.
49724973
49734974
:attr ProcessedAudio processed_audio: Detailed timing information about the service's
49744975
processing of the input audio.
@@ -5945,7 +5946,8 @@ class SpeechRecognitionResults(object):
59455946
methods that support them, it is possible for a `SpeechRecognitionResults` object to
59465947
include only the `speaker_labels` field.
59475948
:attr ProcessingMetrics processing_metrics: (optional) If processing metrics are
5948-
requested, information about the service's processing of the input audio.
5949+
requested, information about the service's processing of the input audio. Processing
5950+
metrics are not available with the synchronous **Recognize audio** method.
59495951
:attr AudioMetrics audio_metrics: (optional) If audio metrics are requested,
59505952
information about the signal characteristics of the input audio.
59515953
:attr list[str] warnings: (optional) An array of warning messages associated with the
@@ -5967,6 +5969,7 @@ def __init__(self,
59675969
results=None,
59685970
result_index=None,
59695971
speaker_labels=None,
5972+
processing_metrics=None,
59705973
audio_metrics=None,
59715974
warnings=None):
59725975
"""
@@ -5990,6 +5993,8 @@ def __init__(self,
59905993
to include only the `speaker_labels` field.
59915994
:param ProcessingMetrics processing_metrics: (optional) If processing metrics are
59925995
requested, information about the service's processing of the input audio.
5996+
Processing metrics are not available with the synchronous **Recognize audio**
5997+
method.
59935998
:param AudioMetrics audio_metrics: (optional) If audio metrics are requested,
59945999
information about the signal characteristics of the input audio.
59956000
:param list[str] warnings: (optional) An array of warning messages associated with
@@ -6010,6 +6015,7 @@ def __init__(self,
60106015
self.results = results
60116016
self.result_index = result_index
60126017
self.speaker_labels = speaker_labels
6018+
self.processing_metrics = processing_metrics
60136019
self.audio_metrics = audio_metrics
60146020
self.warnings = warnings
60156021

@@ -6038,6 +6044,9 @@ def _from_dict(cls, _dict):
60386044
SpeakerLabelsResult._from_dict(x)
60396045
for x in (_dict.get('speaker_labels'))
60406046
]
6047+
if 'processing_metrics' in _dict:
6048+
args['processing_metrics'] = ProcessingMetrics._from_dict(
6049+
_dict.get('processing_metrics'))
60416050
if 'audio_metrics' in _dict:
60426051
args['audio_metrics'] = AudioMetrics._from_dict(
60436052
_dict.get('audio_metrics'))
@@ -6056,6 +6065,10 @@ def _to_dict(self):
60566065
_dict['speaker_labels'] = [
60576066
x._to_dict() for x in self.speaker_labels
60586067
]
6068+
if hasattr(
6069+
self,
6070+
'processing_metrics') and self.processing_metrics is not None:
6071+
_dict['processing_metrics'] = self.processing_metrics._to_dict()
60596072
if hasattr(self, 'audio_metrics') and self.audio_metrics is not None:
60606073
_dict['audio_metrics'] = self.audio_metrics._to_dict()
60616074
if hasattr(self, 'warnings') and self.warnings is not None:
@@ -6154,7 +6167,8 @@ class TrainingResponse(object):
61546167
61556168
:attr list[TrainingWarning] warnings: (optional) An array of `TrainingWarning` objects
61566169
that lists any invalid resources contained in the custom model. For custom language
6157-
models, invalid resources are grouped and identified by type of resource.
6170+
models, invalid resources are grouped and identified by type of resource. The method
6171+
can return warnings only if the `strict` parameter is set to `false`.
61586172
"""
61596173

61606174
def __init__(self, warnings=None):
@@ -6164,6 +6178,7 @@ def __init__(self, warnings=None):
61646178
:param list[TrainingWarning] warnings: (optional) An array of `TrainingWarning`
61656179
objects that lists any invalid resources contained in the custom model. For custom
61666180
language models, invalid resources are grouped and identified by type of resource.
6181+
The method can return warnings only if the `strict` parameter is set to `false`.
61676182
"""
61686183
self.warnings = warnings
61696184

0 commit comments

Comments
 (0)