Skip to content

Commit

Permalink
feat(speech to text): ProcessingMetrics has processing_metrics field
Browse files Browse the repository at this point in the history
  • Loading branch information
ehdsouza committed Jul 23, 2019
1 parent 306e42a commit 482ccd6
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions ibm_watson/speech_to_text_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4968,7 +4968,8 @@ def __ne__(self, other):
class ProcessingMetrics(object):
"""
If processing metrics are requested, information about the service's processing of the
input audio.
input audio. Processing metrics are not available with the synchronous **Recognize
audio** method.
:attr ProcessedAudio processed_audio: Detailed timing information about the service's
processing of the input audio.
Expand Down Expand Up @@ -5945,7 +5946,8 @@ class SpeechRecognitionResults(object):
methods that support them, it is possible for a `SpeechRecognitionResults` object to
include only the `speaker_labels` field.
:attr ProcessingMetrics processing_metrics: (optional) If processing metrics are
requested, information about the service's processing of the input audio.
requested, information about the service's processing of the input audio. Processing
metrics are not available with the synchronous **Recognize audio** method.
:attr AudioMetrics audio_metrics: (optional) If audio metrics are requested,
information about the signal characteristics of the input audio.
:attr list[str] warnings: (optional) An array of warning messages associated with the
Expand All @@ -5967,6 +5969,7 @@ def __init__(self,
results=None,
result_index=None,
speaker_labels=None,
processing_metrics=None,
audio_metrics=None,
warnings=None):
"""
Expand All @@ -5990,6 +5993,8 @@ def __init__(self,
to include only the `speaker_labels` field.
:param ProcessingMetrics processing_metrics: (optional) If processing metrics are
requested, information about the service's processing of the input audio.
Processing metrics are not available with the synchronous **Recognize audio**
method.
:param AudioMetrics audio_metrics: (optional) If audio metrics are requested,
information about the signal characteristics of the input audio.
:param list[str] warnings: (optional) An array of warning messages associated with
Expand All @@ -6010,6 +6015,7 @@ def __init__(self,
self.results = results
self.result_index = result_index
self.speaker_labels = speaker_labels
self.processing_metrics = processing_metrics
self.audio_metrics = audio_metrics
self.warnings = warnings

Expand Down Expand Up @@ -6038,6 +6044,9 @@ def _from_dict(cls, _dict):
SpeakerLabelsResult._from_dict(x)
for x in (_dict.get('speaker_labels'))
]
if 'processing_metrics' in _dict:
args['processing_metrics'] = ProcessingMetrics._from_dict(
_dict.get('processing_metrics'))
if 'audio_metrics' in _dict:
args['audio_metrics'] = AudioMetrics._from_dict(
_dict.get('audio_metrics'))
Expand All @@ -6056,6 +6065,10 @@ def _to_dict(self):
_dict['speaker_labels'] = [
x._to_dict() for x in self.speaker_labels
]
if hasattr(
self,
'processing_metrics') and self.processing_metrics is not None:
_dict['processing_metrics'] = self.processing_metrics._to_dict()
if hasattr(self, 'audio_metrics') and self.audio_metrics is not None:
_dict['audio_metrics'] = self.audio_metrics._to_dict()
if hasattr(self, 'warnings') and self.warnings is not None:
Expand Down Expand Up @@ -6154,7 +6167,8 @@ class TrainingResponse(object):
:attr list[TrainingWarning] warnings: (optional) An array of `TrainingWarning` objects
that lists any invalid resources contained in the custom model. For custom language
models, invalid resources are grouped and identified by type of resource.
models, invalid resources are grouped and identified by type of resource. The method
can return warnings only if the `strict` parameter is set to `false`.
"""

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

Expand Down

0 comments on commit 482ccd6

Please sign in to comment.