synapse.ml.services.speech package

Submodules

synapse.ml.services.speech.ConversationTranscription module

class synapse.ml.services.speech.ConversationTranscription.ConversationTranscription(java_obj=None, audioDataCol=None, endpointId=None, extraFfmpegArgs=[], fileType=None, fileTypeCol=None, format=None, formatCol=None, language=None, languageCol=None, outputCol=None, participantsJson=None, participantsJsonCol=None, profanity=None, profanityCol=None, recordAudioData=False, recordedFileNameCol=None, streamIntermediateResults=True, subscriptionKey=None, subscriptionKeyCol=None, url=None, wordLevelTimestamps=None, wordLevelTimestampsCol=None)[source]

Bases: ComplexParamsMixin, JavaMLReadable, JavaMLWritable, JavaTransformer

Parameters:
  • audioDataCol (str) – Column holding audio data, must be either ByteArrays or Strings representing file URIs

  • endpointId (str) – endpoint for custom speech models

  • extraFfmpegArgs (list) – extra arguments to for ffmpeg output decoding

  • fileType (object) – The file type of the sound files, supported types: wav, ogg, mp3

  • format (object) – Specifies the result format. Accepted values are simple and detailed. Default is simple.

  • language (object) – Identifies the spoken language that is being recognized.

  • outputCol (str) – The name of the output column

  • participantsJson (object) – a json representation of a list of conversation participants (email, language, user)

  • profanity (object) – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

  • recordAudioData (bool) – Whether to record audio data to a file location, for use only with m3u8 streams

  • recordedFileNameCol (str) – Column holding file names to write audio data to if ``recordAudioData’’ is set to true

  • streamIntermediateResults (bool) – Whether or not to immediately return itermediate results, or group in a sequence

  • subscriptionKey (object) – the API key to use

  • url (str) – Url of the service

  • wordLevelTimestamps (object) – Whether to request timestamps foe each indivdual word

audioDataCol = Param(parent='undefined', name='audioDataCol', doc='Column holding audio data, must be either ByteArrays or Strings representing file URIs')
endpointId = Param(parent='undefined', name='endpointId', doc='endpoint for custom speech models')
extraFfmpegArgs = Param(parent='undefined', name='extraFfmpegArgs', doc='extra arguments to for ffmpeg output decoding')
fileType = Param(parent='undefined', name='fileType', doc='ServiceParam: The file type of the sound files, supported types: wav, ogg, mp3')
format = Param(parent='undefined', name='format', doc='ServiceParam:  Specifies the result format. Accepted values are simple and detailed. Default is simple.     ')
getAudioDataCol()[source]
Returns:

Column holding audio data, must be either ByteArrays or Strings representing file URIs

Return type:

audioDataCol

getEndpointId()[source]
Returns:

endpoint for custom speech models

Return type:

endpointId

getExtraFfmpegArgs()[source]
Returns:

extra arguments to for ffmpeg output decoding

Return type:

extraFfmpegArgs

getFileType()[source]
Returns:

The file type of the sound files, supported types: wav, ogg, mp3

Return type:

fileType

getFormat()[source]
Returns:

Specifies the result format. Accepted values are simple and detailed. Default is simple.

Return type:

format

static getJavaPackage()[source]

Returns package name String.

getLanguage()[source]
Returns:

Identifies the spoken language that is being recognized.

Return type:

language

getOutputCol()[source]
Returns:

The name of the output column

Return type:

outputCol

getParticipantsJson()[source]
Returns:

a json representation of a list of conversation participants (email, language, user)

Return type:

participantsJson

getProfanity()[source]
Returns:

Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

Return type:

profanity

getRecordAudioData()[source]
Returns:

Whether to record audio data to a file location, for use only with m3u8 streams

Return type:

recordAudioData

getRecordedFileNameCol()[source]
Returns:

Column holding file names to write audio data to if ``recordAudioData’’ is set to true

Return type:

recordedFileNameCol

getStreamIntermediateResults()[source]
Returns:

Whether or not to immediately return itermediate results, or group in a sequence

Return type:

streamIntermediateResults

getSubscriptionKey()[source]
Returns:

the API key to use

Return type:

subscriptionKey

getUrl()[source]
Returns:

Url of the service

Return type:

url

getWordLevelTimestamps()[source]
Returns:

Whether to request timestamps foe each indivdual word

Return type:

wordLevelTimestamps

language = Param(parent='undefined', name='language', doc='ServiceParam:  Identifies the spoken language that is being recognized.     ')
outputCol = Param(parent='undefined', name='outputCol', doc='The name of the output column')
participantsJson = Param(parent='undefined', name='participantsJson', doc='ServiceParam: a json representation of a list of conversation participants (email, language, user)')
profanity = Param(parent='undefined', name='profanity', doc='ServiceParam:  Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.     ')
classmethod read()[source]

Returns an MLReader instance for this class.

recordAudioData = Param(parent='undefined', name='recordAudioData', doc='Whether to record audio data to a file location, for use only with m3u8 streams')
recordedFileNameCol = Param(parent='undefined', name='recordedFileNameCol', doc="Column holding file names to write audio data to if ``recordAudioData'' is set to true")
setAudioDataCol(value)[source]
Parameters:

audioDataCol – Column holding audio data, must be either ByteArrays or Strings representing file URIs

setEndpointId(value)[source]
Parameters:

endpointId – endpoint for custom speech models

setExtraFfmpegArgs(value)[source]
Parameters:

extraFfmpegArgs – extra arguments to for ffmpeg output decoding

setFileType(value)[source]
Parameters:

fileType – The file type of the sound files, supported types: wav, ogg, mp3

setFileTypeCol(value)[source]
Parameters:

fileType – The file type of the sound files, supported types: wav, ogg, mp3

setFormat(value)[source]
Parameters:

format – Specifies the result format. Accepted values are simple and detailed. Default is simple.

setFormatCol(value)[source]
Parameters:

format – Specifies the result format. Accepted values are simple and detailed. Default is simple.

setLanguage(value)[source]
Parameters:

language – Identifies the spoken language that is being recognized.

setLanguageCol(value)[source]
Parameters:

language – Identifies the spoken language that is being recognized.

setLinkedService(value)[source]
setLocation(value)[source]
setOutputCol(value)[source]
Parameters:

outputCol – The name of the output column

setParams(audioDataCol=None, endpointId=None, extraFfmpegArgs=[], fileType=None, fileTypeCol=None, format=None, formatCol=None, language=None, languageCol=None, outputCol=None, participantsJson=None, participantsJsonCol=None, profanity=None, profanityCol=None, recordAudioData=False, recordedFileNameCol=None, streamIntermediateResults=True, subscriptionKey=None, subscriptionKeyCol=None, url=None, wordLevelTimestamps=None, wordLevelTimestampsCol=None)[source]

Set the (keyword only) parameters

setParticipantsJson(value)[source]
Parameters:

participantsJson – a json representation of a list of conversation participants (email, language, user)

setParticipantsJsonCol(value)[source]
Parameters:

participantsJson – a json representation of a list of conversation participants (email, language, user)

setProfanity(value)[source]
Parameters:

profanity – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

setProfanityCol(value)[source]
Parameters:

profanity – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

setRecordAudioData(value)[source]
Parameters:

recordAudioData – Whether to record audio data to a file location, for use only with m3u8 streams

setRecordedFileNameCol(value)[source]
Parameters:

recordedFileNameCol – Column holding file names to write audio data to if ``recordAudioData’’ is set to true

setStreamIntermediateResults(value)[source]
Parameters:

streamIntermediateResults – Whether or not to immediately return itermediate results, or group in a sequence

setSubscriptionKey(value)[source]
Parameters:

subscriptionKey – the API key to use

setSubscriptionKeyCol(value)[source]
Parameters:

subscriptionKey – the API key to use

setUrl(value)[source]
Parameters:

url – Url of the service

setWordLevelTimestamps(value)[source]
Parameters:

wordLevelTimestamps – Whether to request timestamps foe each indivdual word

setWordLevelTimestampsCol(value)[source]
Parameters:

wordLevelTimestamps – Whether to request timestamps foe each indivdual word

streamIntermediateResults = Param(parent='undefined', name='streamIntermediateResults', doc='Whether or not to immediately return itermediate results, or group in a sequence')
subscriptionKey = Param(parent='undefined', name='subscriptionKey', doc='ServiceParam: the API key to use')
url = Param(parent='undefined', name='url', doc='Url of the service')
wordLevelTimestamps = Param(parent='undefined', name='wordLevelTimestamps', doc='ServiceParam: Whether to request timestamps foe each indivdual word')

synapse.ml.services.speech.SpeakerEmotionInference module

class synapse.ml.services.speech.SpeakerEmotionInference.SpeakerEmotionInference(java_obj=None, AADToken=None, AADTokenCol=None, CustomAuthHeader=None, CustomAuthHeaderCol=None, concurrency=1, concurrentTimeout=None, errorCol='SpeakerEmotionInference_237b956bdbc5_error', handler=None, locale=None, localeCol=None, outputCol='SpeakerEmotionInference_237b956bdbc5_output', subscriptionKey=None, subscriptionKeyCol=None, text=None, textCol=None, timeout=60.0, url=None, voiceName=None, voiceNameCol=None)[source]

Bases: ComplexParamsMixin, JavaMLReadable, JavaMLWritable, JavaTransformer

Parameters:
  • AADToken (object) – AAD Token used for authentication

  • CustomAuthHeader (object) – A Custom Value for Authorization Header

  • concurrency (int) – max number of concurrent calls

  • concurrentTimeout (float) – max number seconds to wait on futures if concurrency >= 1

  • errorCol (str) – column to hold http errors

  • handler (object) – Which strategy to use when handling requests

  • locale (object) – The locale of the input text

  • outputCol (str) – The name of the output column

  • subscriptionKey (object) – the API key to use

  • text (object) – The text to annotate with inferred emotion

  • timeout (float) – number of seconds to wait before closing the connection

  • url (str) – Url of the service

  • voiceName (object) – The name of the voice used for synthesis

AADToken = Param(parent='undefined', name='AADToken', doc='ServiceParam: AAD Token used for authentication')
CustomAuthHeader = Param(parent='undefined', name='CustomAuthHeader', doc='ServiceParam: A Custom Value for Authorization Header')
concurrency = Param(parent='undefined', name='concurrency', doc='max number of concurrent calls')
concurrentTimeout = Param(parent='undefined', name='concurrentTimeout', doc='max number seconds to wait on futures if concurrency >= 1')
errorCol = Param(parent='undefined', name='errorCol', doc='column to hold http errors')
getAADToken()[source]
Returns:

AAD Token used for authentication

Return type:

AADToken

getConcurrency()[source]
Returns:

max number of concurrent calls

Return type:

concurrency

getConcurrentTimeout()[source]
Returns:

max number seconds to wait on futures if concurrency >= 1

Return type:

concurrentTimeout

getCustomAuthHeader()[source]
Returns:

A Custom Value for Authorization Header

Return type:

CustomAuthHeader

getErrorCol()[source]
Returns:

column to hold http errors

Return type:

errorCol

getHandler()[source]
Returns:

Which strategy to use when handling requests

Return type:

handler

static getJavaPackage()[source]

Returns package name String.

getLocale()[source]
Returns:

The locale of the input text

Return type:

locale

getOutputCol()[source]
Returns:

The name of the output column

Return type:

outputCol

getSubscriptionKey()[source]
Returns:

the API key to use

Return type:

subscriptionKey

getText()[source]
Returns:

The text to annotate with inferred emotion

Return type:

text

getTimeout()[source]
Returns:

number of seconds to wait before closing the connection

Return type:

timeout

getUrl()[source]
Returns:

Url of the service

Return type:

url

getVoiceName()[source]
Returns:

The name of the voice used for synthesis

Return type:

voiceName

handler = Param(parent='undefined', name='handler', doc='Which strategy to use when handling requests')
locale = Param(parent='undefined', name='locale', doc='ServiceParam: The locale of the input text')
outputCol = Param(parent='undefined', name='outputCol', doc='The name of the output column')
classmethod read()[source]

Returns an MLReader instance for this class.

setAADToken(value)[source]
Parameters:

AADToken – AAD Token used for authentication

setAADTokenCol(value)[source]
Parameters:

AADToken – AAD Token used for authentication

setConcurrency(value)[source]
Parameters:

concurrency – max number of concurrent calls

setConcurrentTimeout(value)[source]
Parameters:

concurrentTimeout – max number seconds to wait on futures if concurrency >= 1

setCustomAuthHeader(value)[source]
Parameters:

CustomAuthHeader – A Custom Value for Authorization Header

setCustomAuthHeaderCol(value)[source]
Parameters:

CustomAuthHeader – A Custom Value for Authorization Header

setCustomServiceName(value)[source]
setDefaultInternalEndpoint(value)[source]
setEndpoint(value)[source]
setErrorCol(value)[source]
Parameters:

errorCol – column to hold http errors

setHandler(value)[source]
Parameters:

handler – Which strategy to use when handling requests

setLocale(value)[source]
Parameters:

locale – The locale of the input text

setLocaleCol(value)[source]
Parameters:

locale – The locale of the input text

setLocation(value)[source]
setOutputCol(value)[source]
Parameters:

outputCol – The name of the output column

setParams(AADToken=None, AADTokenCol=None, CustomAuthHeader=None, CustomAuthHeaderCol=None, concurrency=1, concurrentTimeout=None, errorCol='SpeakerEmotionInference_237b956bdbc5_error', handler=None, locale=None, localeCol=None, outputCol='SpeakerEmotionInference_237b956bdbc5_output', subscriptionKey=None, subscriptionKeyCol=None, text=None, textCol=None, timeout=60.0, url=None, voiceName=None, voiceNameCol=None)[source]

Set the (keyword only) parameters

setSubscriptionKey(value)[source]
Parameters:

subscriptionKey – the API key to use

setSubscriptionKeyCol(value)[source]
Parameters:

subscriptionKey – the API key to use

setText(value)[source]
Parameters:

text – The text to annotate with inferred emotion

setTextCol(value)[source]
Parameters:

text – The text to annotate with inferred emotion

setTimeout(value)[source]
Parameters:

timeout – number of seconds to wait before closing the connection

setUrl(value)[source]
Parameters:

url – Url of the service

setVoiceName(value)[source]
Parameters:

voiceName – The name of the voice used for synthesis

setVoiceNameCol(value)[source]
Parameters:

voiceName – The name of the voice used for synthesis

subscriptionKey = Param(parent='undefined', name='subscriptionKey', doc='ServiceParam: the API key to use')
text = Param(parent='undefined', name='text', doc='ServiceParam: The text to annotate with inferred emotion')
timeout = Param(parent='undefined', name='timeout', doc='number of seconds to wait before closing the connection')
url = Param(parent='undefined', name='url', doc='Url of the service')
voiceName = Param(parent='undefined', name='voiceName', doc='ServiceParam: The name of the voice used for synthesis')

synapse.ml.services.speech.SpeechToText module

class synapse.ml.services.speech.SpeechToText.SpeechToText(java_obj=None, AADToken=None, AADTokenCol=None, CustomAuthHeader=None, CustomAuthHeaderCol=None, audioData=None, audioDataCol=None, concurrency=1, concurrentTimeout=None, errorCol='SpeechToText_2e25b349cf07_error', format=None, formatCol=None, handler=None, language=None, languageCol=None, outputCol='SpeechToText_2e25b349cf07_output', profanity=None, profanityCol=None, subscriptionKey=None, subscriptionKeyCol=None, timeout=60.0, url=None)[source]

Bases: ComplexParamsMixin, JavaMLReadable, JavaMLWritable, JavaTransformer

Parameters:
  • AADToken (object) – AAD Token used for authentication

  • CustomAuthHeader (object) – A Custom Value for Authorization Header

  • audioData (object) – The data sent to the service must be a .wav files

  • concurrency (int) – max number of concurrent calls

  • concurrentTimeout (float) – max number seconds to wait on futures if concurrency >= 1

  • errorCol (str) – column to hold http errors

  • format (object) – Specifies the result format. Accepted values are simple and detailed. Default is simple.

  • handler (object) – Which strategy to use when handling requests

  • language (object) – Identifies the spoken language that is being recognized.

  • outputCol (str) – The name of the output column

  • profanity (object) – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

  • subscriptionKey (object) – the API key to use

  • timeout (float) – number of seconds to wait before closing the connection

  • url (str) – Url of the service

AADToken = Param(parent='undefined', name='AADToken', doc='ServiceParam: AAD Token used for authentication')
CustomAuthHeader = Param(parent='undefined', name='CustomAuthHeader', doc='ServiceParam: A Custom Value for Authorization Header')
audioData = Param(parent='undefined', name='audioData', doc='ServiceParam:  The data sent to the service must be a .wav files     ')
concurrency = Param(parent='undefined', name='concurrency', doc='max number of concurrent calls')
concurrentTimeout = Param(parent='undefined', name='concurrentTimeout', doc='max number seconds to wait on futures if concurrency >= 1')
errorCol = Param(parent='undefined', name='errorCol', doc='column to hold http errors')
format = Param(parent='undefined', name='format', doc='ServiceParam:  Specifies the result format. Accepted values are simple and detailed. Default is simple.     ')
getAADToken()[source]
Returns:

AAD Token used for authentication

Return type:

AADToken

getAudioData()[source]
Returns:

The data sent to the service must be a .wav files

Return type:

audioData

getConcurrency()[source]
Returns:

max number of concurrent calls

Return type:

concurrency

getConcurrentTimeout()[source]
Returns:

max number seconds to wait on futures if concurrency >= 1

Return type:

concurrentTimeout

getCustomAuthHeader()[source]
Returns:

A Custom Value for Authorization Header

Return type:

CustomAuthHeader

getErrorCol()[source]
Returns:

column to hold http errors

Return type:

errorCol

getFormat()[source]
Returns:

Specifies the result format. Accepted values are simple and detailed. Default is simple.

Return type:

format

getHandler()[source]
Returns:

Which strategy to use when handling requests

Return type:

handler

static getJavaPackage()[source]

Returns package name String.

getLanguage()[source]
Returns:

Identifies the spoken language that is being recognized.

Return type:

language

getOutputCol()[source]
Returns:

The name of the output column

Return type:

outputCol

getProfanity()[source]
Returns:

Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

Return type:

profanity

getSubscriptionKey()[source]
Returns:

the API key to use

Return type:

subscriptionKey

getTimeout()[source]
Returns:

number of seconds to wait before closing the connection

Return type:

timeout

getUrl()[source]
Returns:

Url of the service

Return type:

url

handler = Param(parent='undefined', name='handler', doc='Which strategy to use when handling requests')
language = Param(parent='undefined', name='language', doc='ServiceParam:  Identifies the spoken language that is being recognized.     ')
outputCol = Param(parent='undefined', name='outputCol', doc='The name of the output column')
profanity = Param(parent='undefined', name='profanity', doc='ServiceParam:  Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.     ')
classmethod read()[source]

Returns an MLReader instance for this class.

setAADToken(value)[source]
Parameters:

AADToken – AAD Token used for authentication

setAADTokenCol(value)[source]
Parameters:

AADToken – AAD Token used for authentication

setAudioData(value)[source]
Parameters:

audioData – The data sent to the service must be a .wav files

setAudioDataCol(value)[source]
Parameters:

audioData – The data sent to the service must be a .wav files

setConcurrency(value)[source]
Parameters:

concurrency – max number of concurrent calls

setConcurrentTimeout(value)[source]
Parameters:

concurrentTimeout – max number seconds to wait on futures if concurrency >= 1

setCustomAuthHeader(value)[source]
Parameters:

CustomAuthHeader – A Custom Value for Authorization Header

setCustomAuthHeaderCol(value)[source]
Parameters:

CustomAuthHeader – A Custom Value for Authorization Header

setCustomServiceName(value)[source]
setDefaultInternalEndpoint(value)[source]
setEndpoint(value)[source]
setErrorCol(value)[source]
Parameters:

errorCol – column to hold http errors

setFormat(value)[source]
Parameters:

format – Specifies the result format. Accepted values are simple and detailed. Default is simple.

setFormatCol(value)[source]
Parameters:

format – Specifies the result format. Accepted values are simple and detailed. Default is simple.

setHandler(value)[source]
Parameters:

handler – Which strategy to use when handling requests

setLanguage(value)[source]
Parameters:

language – Identifies the spoken language that is being recognized.

setLanguageCol(value)[source]
Parameters:

language – Identifies the spoken language that is being recognized.

setLinkedService(value)[source]
setLocation(value)[source]
setOutputCol(value)[source]
Parameters:

outputCol – The name of the output column

setParams(AADToken=None, AADTokenCol=None, CustomAuthHeader=None, CustomAuthHeaderCol=None, audioData=None, audioDataCol=None, concurrency=1, concurrentTimeout=None, errorCol='SpeechToText_2e25b349cf07_error', format=None, formatCol=None, handler=None, language=None, languageCol=None, outputCol='SpeechToText_2e25b349cf07_output', profanity=None, profanityCol=None, subscriptionKey=None, subscriptionKeyCol=None, timeout=60.0, url=None)[source]

Set the (keyword only) parameters

setProfanity(value)[source]
Parameters:

profanity – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

setProfanityCol(value)[source]
Parameters:

profanity – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

setSubscriptionKey(value)[source]
Parameters:

subscriptionKey – the API key to use

setSubscriptionKeyCol(value)[source]
Parameters:

subscriptionKey – the API key to use

setTimeout(value)[source]
Parameters:

timeout – number of seconds to wait before closing the connection

setUrl(value)[source]
Parameters:

url – Url of the service

subscriptionKey = Param(parent='undefined', name='subscriptionKey', doc='ServiceParam: the API key to use')
timeout = Param(parent='undefined', name='timeout', doc='number of seconds to wait before closing the connection')
url = Param(parent='undefined', name='url', doc='Url of the service')

synapse.ml.services.speech.SpeechToTextSDK module

class synapse.ml.services.speech.SpeechToTextSDK.SpeechToTextSDK(java_obj=None, audioDataCol=None, endpointId=None, extraFfmpegArgs=[], fileType=None, fileTypeCol=None, format=None, formatCol=None, language=None, languageCol=None, outputCol=None, participantsJson=None, participantsJsonCol=None, profanity=None, profanityCol=None, recordAudioData=False, recordedFileNameCol=None, streamIntermediateResults=True, subscriptionKey=None, subscriptionKeyCol=None, url=None, wordLevelTimestamps=None, wordLevelTimestampsCol=None)[source]

Bases: ComplexParamsMixin, JavaMLReadable, JavaMLWritable, JavaTransformer

Parameters:
  • audioDataCol (str) – Column holding audio data, must be either ByteArrays or Strings representing file URIs

  • endpointId (str) – endpoint for custom speech models

  • extraFfmpegArgs (list) – extra arguments to for ffmpeg output decoding

  • fileType (object) – The file type of the sound files, supported types: wav, ogg, mp3

  • format (object) – Specifies the result format. Accepted values are simple and detailed. Default is simple.

  • language (object) – Identifies the spoken language that is being recognized.

  • outputCol (str) – The name of the output column

  • participantsJson (object) – a json representation of a list of conversation participants (email, language, user)

  • profanity (object) – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

  • recordAudioData (bool) – Whether to record audio data to a file location, for use only with m3u8 streams

  • recordedFileNameCol (str) – Column holding file names to write audio data to if ``recordAudioData’’ is set to true

  • streamIntermediateResults (bool) – Whether or not to immediately return itermediate results, or group in a sequence

  • subscriptionKey (object) – the API key to use

  • url (str) – Url of the service

  • wordLevelTimestamps (object) – Whether to request timestamps foe each indivdual word

audioDataCol = Param(parent='undefined', name='audioDataCol', doc='Column holding audio data, must be either ByteArrays or Strings representing file URIs')
endpointId = Param(parent='undefined', name='endpointId', doc='endpoint for custom speech models')
extraFfmpegArgs = Param(parent='undefined', name='extraFfmpegArgs', doc='extra arguments to for ffmpeg output decoding')
fileType = Param(parent='undefined', name='fileType', doc='ServiceParam: The file type of the sound files, supported types: wav, ogg, mp3')
format = Param(parent='undefined', name='format', doc='ServiceParam:  Specifies the result format. Accepted values are simple and detailed. Default is simple.     ')
getAudioDataCol()[source]
Returns:

Column holding audio data, must be either ByteArrays or Strings representing file URIs

Return type:

audioDataCol

getEndpointId()[source]
Returns:

endpoint for custom speech models

Return type:

endpointId

getExtraFfmpegArgs()[source]
Returns:

extra arguments to for ffmpeg output decoding

Return type:

extraFfmpegArgs

getFileType()[source]
Returns:

The file type of the sound files, supported types: wav, ogg, mp3

Return type:

fileType

getFormat()[source]
Returns:

Specifies the result format. Accepted values are simple and detailed. Default is simple.

Return type:

format

static getJavaPackage()[source]

Returns package name String.

getLanguage()[source]
Returns:

Identifies the spoken language that is being recognized.

Return type:

language

getOutputCol()[source]
Returns:

The name of the output column

Return type:

outputCol

getParticipantsJson()[source]
Returns:

a json representation of a list of conversation participants (email, language, user)

Return type:

participantsJson

getProfanity()[source]
Returns:

Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

Return type:

profanity

getRecordAudioData()[source]
Returns:

Whether to record audio data to a file location, for use only with m3u8 streams

Return type:

recordAudioData

getRecordedFileNameCol()[source]
Returns:

Column holding file names to write audio data to if ``recordAudioData’’ is set to true

Return type:

recordedFileNameCol

getStreamIntermediateResults()[source]
Returns:

Whether or not to immediately return itermediate results, or group in a sequence

Return type:

streamIntermediateResults

getSubscriptionKey()[source]
Returns:

the API key to use

Return type:

subscriptionKey

getUrl()[source]
Returns:

Url of the service

Return type:

url

getWordLevelTimestamps()[source]
Returns:

Whether to request timestamps foe each indivdual word

Return type:

wordLevelTimestamps

language = Param(parent='undefined', name='language', doc='ServiceParam:  Identifies the spoken language that is being recognized.     ')
outputCol = Param(parent='undefined', name='outputCol', doc='The name of the output column')
participantsJson = Param(parent='undefined', name='participantsJson', doc='ServiceParam: a json representation of a list of conversation participants (email, language, user)')
profanity = Param(parent='undefined', name='profanity', doc='ServiceParam:  Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.     ')
classmethod read()[source]

Returns an MLReader instance for this class.

recordAudioData = Param(parent='undefined', name='recordAudioData', doc='Whether to record audio data to a file location, for use only with m3u8 streams')
recordedFileNameCol = Param(parent='undefined', name='recordedFileNameCol', doc="Column holding file names to write audio data to if ``recordAudioData'' is set to true")
setAudioDataCol(value)[source]
Parameters:

audioDataCol – Column holding audio data, must be either ByteArrays or Strings representing file URIs

setEndpointId(value)[source]
Parameters:

endpointId – endpoint for custom speech models

setExtraFfmpegArgs(value)[source]
Parameters:

extraFfmpegArgs – extra arguments to for ffmpeg output decoding

setFileType(value)[source]
Parameters:

fileType – The file type of the sound files, supported types: wav, ogg, mp3

setFileTypeCol(value)[source]
Parameters:

fileType – The file type of the sound files, supported types: wav, ogg, mp3

setFormat(value)[source]
Parameters:

format – Specifies the result format. Accepted values are simple and detailed. Default is simple.

setFormatCol(value)[source]
Parameters:

format – Specifies the result format. Accepted values are simple and detailed. Default is simple.

setLanguage(value)[source]
Parameters:

language – Identifies the spoken language that is being recognized.

setLanguageCol(value)[source]
Parameters:

language – Identifies the spoken language that is being recognized.

setLinkedService(value)[source]
setLocation(value)[source]
setOutputCol(value)[source]
Parameters:

outputCol – The name of the output column

setParams(audioDataCol=None, endpointId=None, extraFfmpegArgs=[], fileType=None, fileTypeCol=None, format=None, formatCol=None, language=None, languageCol=None, outputCol=None, participantsJson=None, participantsJsonCol=None, profanity=None, profanityCol=None, recordAudioData=False, recordedFileNameCol=None, streamIntermediateResults=True, subscriptionKey=None, subscriptionKeyCol=None, url=None, wordLevelTimestamps=None, wordLevelTimestampsCol=None)[source]

Set the (keyword only) parameters

setParticipantsJson(value)[source]
Parameters:

participantsJson – a json representation of a list of conversation participants (email, language, user)

setParticipantsJsonCol(value)[source]
Parameters:

participantsJson – a json representation of a list of conversation participants (email, language, user)

setProfanity(value)[source]
Parameters:

profanity – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

setProfanityCol(value)[source]
Parameters:

profanity – Specifies how to handle profanity in recognition results. Accepted values are masked, which replaces profanity with asterisks, removed, which remove all profanity from the result, or raw, which includes the profanity in the result. The default setting is masked.

setRecordAudioData(value)[source]
Parameters:

recordAudioData – Whether to record audio data to a file location, for use only with m3u8 streams

setRecordedFileNameCol(value)[source]
Parameters:

recordedFileNameCol – Column holding file names to write audio data to if ``recordAudioData’’ is set to true

setStreamIntermediateResults(value)[source]
Parameters:

streamIntermediateResults – Whether or not to immediately return itermediate results, or group in a sequence

setSubscriptionKey(value)[source]
Parameters:

subscriptionKey – the API key to use

setSubscriptionKeyCol(value)[source]
Parameters:

subscriptionKey – the API key to use

setUrl(value)[source]
Parameters:

url – Url of the service

setWordLevelTimestamps(value)[source]
Parameters:

wordLevelTimestamps – Whether to request timestamps foe each indivdual word

setWordLevelTimestampsCol(value)[source]
Parameters:

wordLevelTimestamps – Whether to request timestamps foe each indivdual word

streamIntermediateResults = Param(parent='undefined', name='streamIntermediateResults', doc='Whether or not to immediately return itermediate results, or group in a sequence')
subscriptionKey = Param(parent='undefined', name='subscriptionKey', doc='ServiceParam: the API key to use')
url = Param(parent='undefined', name='url', doc='Url of the service')
wordLevelTimestamps = Param(parent='undefined', name='wordLevelTimestamps', doc='ServiceParam: Whether to request timestamps foe each indivdual word')

synapse.ml.services.speech.TextToSpeech module

class synapse.ml.services.speech.TextToSpeech.TextToSpeech(java_obj=None, errorCol='TextToSpeech_54c766513efd_errors', language=None, languageCol=None, locale=None, localeCol=None, outputFileCol=None, outputFormat=None, outputFormatCol=None, subscriptionKey=None, subscriptionKeyCol=None, text=None, textCol=None, url=None, useSSML=None, useSSMLCol=None, voiceName=None, voiceNameCol=None)[source]

Bases: ComplexParamsMixin, JavaMLReadable, JavaMLWritable, JavaTransformer

Parameters:
  • errorCol (str) – column to hold http errors

  • language (object) – The name of the language used for synthesis

  • locale (object) – The locale of the input text

  • outputFileCol (str) – The location of the saved file as an HDFS compliant URI

  • outputFormat (object) – The format for the output audio can be one of ArraySeq(Raw8Khz8BitMonoMULaw, Riff16Khz16KbpsMonoSiren, Audio16Khz16KbpsMonoSiren, Audio16Khz32KBitRateMonoMp3, Audio16Khz128KBitRateMonoMp3, Audio16Khz64KBitRateMonoMp3, Audio24Khz48KBitRateMonoMp3, Audio24Khz96KBitRateMonoMp3, Audio24Khz160KBitRateMonoMp3, Raw16Khz16BitMonoTrueSilk, Riff16Khz16BitMonoPcm, Riff8Khz16BitMonoPcm, Riff24Khz16BitMonoPcm, Riff8Khz8BitMonoMULaw, Raw16Khz16BitMonoPcm, Raw24Khz16BitMonoPcm, Raw8Khz16BitMonoPcm, Ogg16Khz16BitMonoOpus, Ogg24Khz16BitMonoOpus, Raw48Khz16BitMonoPcm, Riff48Khz16BitMonoPcm, Audio48Khz96KBitRateMonoMp3, Audio48Khz192KBitRateMonoMp3, Ogg48Khz16BitMonoOpus, Webm16Khz16BitMonoOpus, Webm24Khz16BitMonoOpus, Raw24Khz16BitMonoTrueSilk, Raw8Khz8BitMonoALaw, Riff8Khz8BitMonoALaw, Webm24Khz16Bit24KbpsMonoOpus, Audio16Khz16Bit32KbpsMonoOpus, Audio24Khz16Bit48KbpsMonoOpus, Audio24Khz16Bit24KbpsMonoOpus, Raw22050Hz16BitMonoPcm, Riff22050Hz16BitMonoPcm, Raw44100Hz16BitMonoPcm, Riff44100Hz16BitMonoPcm, AmrWb16000Hz)

  • subscriptionKey (object) – the API key to use

  • text (object) – The text to synthesize

  • url (str) – Url of the service

  • useSSML (object) – whether to interpret the provided text input as SSML (Speech Synthesis Markup Language). The default value is false.

  • voiceName (object) – The name of the voice used for synthesis

errorCol = Param(parent='undefined', name='errorCol', doc='column to hold http errors')
getErrorCol()[source]
Returns:

column to hold http errors

Return type:

errorCol

static getJavaPackage()[source]

Returns package name String.

getLanguage()[source]
Returns:

The name of the language used for synthesis

Return type:

language

getLocale()[source]
Returns:

The locale of the input text

Return type:

locale

getOutputFileCol()[source]
Returns:

The location of the saved file as an HDFS compliant URI

Return type:

outputFileCol

getOutputFormat()[source]
Returns:

The format for the output audio can be one of ArraySeq(Raw8Khz8BitMonoMULaw, Riff16Khz16KbpsMonoSiren, Audio16Khz16KbpsMonoSiren, Audio16Khz32KBitRateMonoMp3, Audio16Khz128KBitRateMonoMp3, Audio16Khz64KBitRateMonoMp3, Audio24Khz48KBitRateMonoMp3, Audio24Khz96KBitRateMonoMp3, Audio24Khz160KBitRateMonoMp3, Raw16Khz16BitMonoTrueSilk, Riff16Khz16BitMonoPcm, Riff8Khz16BitMonoPcm, Riff24Khz16BitMonoPcm, Riff8Khz8BitMonoMULaw, Raw16Khz16BitMonoPcm, Raw24Khz16BitMonoPcm, Raw8Khz16BitMonoPcm, Ogg16Khz16BitMonoOpus, Ogg24Khz16BitMonoOpus, Raw48Khz16BitMonoPcm, Riff48Khz16BitMonoPcm, Audio48Khz96KBitRateMonoMp3, Audio48Khz192KBitRateMonoMp3, Ogg48Khz16BitMonoOpus, Webm16Khz16BitMonoOpus, Webm24Khz16BitMonoOpus, Raw24Khz16BitMonoTrueSilk, Raw8Khz8BitMonoALaw, Riff8Khz8BitMonoALaw, Webm24Khz16Bit24KbpsMonoOpus, Audio16Khz16Bit32KbpsMonoOpus, Audio24Khz16Bit48KbpsMonoOpus, Audio24Khz16Bit24KbpsMonoOpus, Raw22050Hz16BitMonoPcm, Riff22050Hz16BitMonoPcm, Raw44100Hz16BitMonoPcm, Riff44100Hz16BitMonoPcm, AmrWb16000Hz)

Return type:

outputFormat

getSubscriptionKey()[source]
Returns:

the API key to use

Return type:

subscriptionKey

getText()[source]
Returns:

The text to synthesize

Return type:

text

getUrl()[source]
Returns:

Url of the service

Return type:

url

getUseSSML()[source]
Returns:

whether to interpret the provided text input as SSML (Speech Synthesis Markup Language). The default value is false.

Return type:

useSSML

getVoiceName()[source]
Returns:

The name of the voice used for synthesis

Return type:

voiceName

language = Param(parent='undefined', name='language', doc='ServiceParam: The name of the language used for synthesis')
locale = Param(parent='undefined', name='locale', doc='ServiceParam: The locale of the input text')
outputFileCol = Param(parent='undefined', name='outputFileCol', doc='The location of the saved file as an HDFS compliant URI')
outputFormat = Param(parent='undefined', name='outputFormat', doc='ServiceParam: The format for the output audio can be one of ArraySeq(Raw8Khz8BitMonoMULaw, Riff16Khz16KbpsMonoSiren, Audio16Khz16KbpsMonoSiren, Audio16Khz32KBitRateMonoMp3, Audio16Khz128KBitRateMonoMp3, Audio16Khz64KBitRateMonoMp3, Audio24Khz48KBitRateMonoMp3, Audio24Khz96KBitRateMonoMp3, Audio24Khz160KBitRateMonoMp3, Raw16Khz16BitMonoTrueSilk, Riff16Khz16BitMonoPcm, Riff8Khz16BitMonoPcm, Riff24Khz16BitMonoPcm, Riff8Khz8BitMonoMULaw, Raw16Khz16BitMonoPcm, Raw24Khz16BitMonoPcm, Raw8Khz16BitMonoPcm, Ogg16Khz16BitMonoOpus, Ogg24Khz16BitMonoOpus, Raw48Khz16BitMonoPcm, Riff48Khz16BitMonoPcm, Audio48Khz96KBitRateMonoMp3, Audio48Khz192KBitRateMonoMp3, Ogg48Khz16BitMonoOpus, Webm16Khz16BitMonoOpus, Webm24Khz16BitMonoOpus, Raw24Khz16BitMonoTrueSilk, Raw8Khz8BitMonoALaw, Riff8Khz8BitMonoALaw, Webm24Khz16Bit24KbpsMonoOpus, Audio16Khz16Bit32KbpsMonoOpus, Audio24Khz16Bit48KbpsMonoOpus, Audio24Khz16Bit24KbpsMonoOpus, Raw22050Hz16BitMonoPcm, Riff22050Hz16BitMonoPcm, Raw44100Hz16BitMonoPcm, Riff44100Hz16BitMonoPcm, AmrWb16000Hz)')
classmethod read()[source]

Returns an MLReader instance for this class.

setErrorCol(value)[source]
Parameters:

errorCol – column to hold http errors

setLanguage(value)[source]
Parameters:

language – The name of the language used for synthesis

setLanguageCol(value)[source]
Parameters:

language – The name of the language used for synthesis

setLinkedService(value)[source]
setLocale(value)[source]
Parameters:

locale – The locale of the input text

setLocaleCol(value)[source]
Parameters:

locale – The locale of the input text

setLocation(value)[source]
setOutputFileCol(value)[source]
Parameters:

outputFileCol – The location of the saved file as an HDFS compliant URI

setOutputFormat(value)[source]
Parameters:

outputFormat – The format for the output audio can be one of ArraySeq(Raw8Khz8BitMonoMULaw, Riff16Khz16KbpsMonoSiren, Audio16Khz16KbpsMonoSiren, Audio16Khz32KBitRateMonoMp3, Audio16Khz128KBitRateMonoMp3, Audio16Khz64KBitRateMonoMp3, Audio24Khz48KBitRateMonoMp3, Audio24Khz96KBitRateMonoMp3, Audio24Khz160KBitRateMonoMp3, Raw16Khz16BitMonoTrueSilk, Riff16Khz16BitMonoPcm, Riff8Khz16BitMonoPcm, Riff24Khz16BitMonoPcm, Riff8Khz8BitMonoMULaw, Raw16Khz16BitMonoPcm, Raw24Khz16BitMonoPcm, Raw8Khz16BitMonoPcm, Ogg16Khz16BitMonoOpus, Ogg24Khz16BitMonoOpus, Raw48Khz16BitMonoPcm, Riff48Khz16BitMonoPcm, Audio48Khz96KBitRateMonoMp3, Audio48Khz192KBitRateMonoMp3, Ogg48Khz16BitMonoOpus, Webm16Khz16BitMonoOpus, Webm24Khz16BitMonoOpus, Raw24Khz16BitMonoTrueSilk, Raw8Khz8BitMonoALaw, Riff8Khz8BitMonoALaw, Webm24Khz16Bit24KbpsMonoOpus, Audio16Khz16Bit32KbpsMonoOpus, Audio24Khz16Bit48KbpsMonoOpus, Audio24Khz16Bit24KbpsMonoOpus, Raw22050Hz16BitMonoPcm, Riff22050Hz16BitMonoPcm, Raw44100Hz16BitMonoPcm, Riff44100Hz16BitMonoPcm, AmrWb16000Hz)

setOutputFormatCol(value)[source]
Parameters:

outputFormat – The format for the output audio can be one of ArraySeq(Raw8Khz8BitMonoMULaw, Riff16Khz16KbpsMonoSiren, Audio16Khz16KbpsMonoSiren, Audio16Khz32KBitRateMonoMp3, Audio16Khz128KBitRateMonoMp3, Audio16Khz64KBitRateMonoMp3, Audio24Khz48KBitRateMonoMp3, Audio24Khz96KBitRateMonoMp3, Audio24Khz160KBitRateMonoMp3, Raw16Khz16BitMonoTrueSilk, Riff16Khz16BitMonoPcm, Riff8Khz16BitMonoPcm, Riff24Khz16BitMonoPcm, Riff8Khz8BitMonoMULaw, Raw16Khz16BitMonoPcm, Raw24Khz16BitMonoPcm, Raw8Khz16BitMonoPcm, Ogg16Khz16BitMonoOpus, Ogg24Khz16BitMonoOpus, Raw48Khz16BitMonoPcm, Riff48Khz16BitMonoPcm, Audio48Khz96KBitRateMonoMp3, Audio48Khz192KBitRateMonoMp3, Ogg48Khz16BitMonoOpus, Webm16Khz16BitMonoOpus, Webm24Khz16BitMonoOpus, Raw24Khz16BitMonoTrueSilk, Raw8Khz8BitMonoALaw, Riff8Khz8BitMonoALaw, Webm24Khz16Bit24KbpsMonoOpus, Audio16Khz16Bit32KbpsMonoOpus, Audio24Khz16Bit48KbpsMonoOpus, Audio24Khz16Bit24KbpsMonoOpus, Raw22050Hz16BitMonoPcm, Riff22050Hz16BitMonoPcm, Raw44100Hz16BitMonoPcm, Riff44100Hz16BitMonoPcm, AmrWb16000Hz)

setParams(errorCol='TextToSpeech_54c766513efd_errors', language=None, languageCol=None, locale=None, localeCol=None, outputFileCol=None, outputFormat=None, outputFormatCol=None, subscriptionKey=None, subscriptionKeyCol=None, text=None, textCol=None, url=None, useSSML=None, useSSMLCol=None, voiceName=None, voiceNameCol=None)[source]

Set the (keyword only) parameters

setSubscriptionKey(value)[source]
Parameters:

subscriptionKey – the API key to use

setSubscriptionKeyCol(value)[source]
Parameters:

subscriptionKey – the API key to use

setText(value)[source]
Parameters:

text – The text to synthesize

setTextCol(value)[source]
Parameters:

text – The text to synthesize

setUrl(value)[source]
Parameters:

url – Url of the service

setUseSSML(value)[source]
Parameters:

useSSML – whether to interpret the provided text input as SSML (Speech Synthesis Markup Language). The default value is false.

setUseSSMLCol(value)[source]
Parameters:

useSSML – whether to interpret the provided text input as SSML (Speech Synthesis Markup Language). The default value is false.

setVoiceName(value)[source]
Parameters:

voiceName – The name of the voice used for synthesis

setVoiceNameCol(value)[source]
Parameters:

voiceName – The name of the voice used for synthesis

subscriptionKey = Param(parent='undefined', name='subscriptionKey', doc='ServiceParam: the API key to use')
text = Param(parent='undefined', name='text', doc='ServiceParam: The text to synthesize')
url = Param(parent='undefined', name='url', doc='Url of the service')
useSSML = Param(parent='undefined', name='useSSML', doc='ServiceParam: whether to interpret the provided text input as SSML (Speech Synthesis Markup Language). The default value is false.')
voiceName = Param(parent='undefined', name='voiceName', doc='ServiceParam: The name of the voice used for synthesis')

Module contents

SynapseML is an ecosystem of tools aimed towards expanding the distributed computing framework Apache Spark in several new directions. SynapseML adds many deep learning and data science tools to the Spark ecosystem, including seamless integration of Spark Machine Learning pipelines with Microsoft Cognitive Toolkit (CNTK), LightGBM and OpenCV. These tools enable powerful and highly-scalable predictive and analytical models for a variety of datasources.

SynapseML also brings new networking capabilities to the Spark Ecosystem. With the HTTP on Spark project, users can embed any web service into their SparkML models. In this vein, SynapseML provides easy to use SparkML transformers for a wide variety of Microsoft Cognitive Services. For production grade deployment, the Spark Serving project enables high throughput, sub-millisecond latency web services, backed by your Spark cluster.

SynapseML requires Scala 2.12, Spark 3.0+, and Python 3.6+.