Watson Developer Cloud Unity SDK  1.0.0
The Unity SDK uses the Watson Developer Cloud services, a collection of REST APIs and SDKs that use cognitive computing to solve complex problems.
IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText Class Reference

This class wraps the Watson Speech to Text service. Speech to Text Service More...

Inheritance diagram for IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText:
IBM.Watson.DeveloperCloud.Services.IWatsonService

Public Member Functions

delegate void ErrorEvent (string error)
 This callback is used to return errors through the OnError property. More...
 
delegate byte[] LoadFileDelegate (string filename)
 The delegate for loading a file. More...
 
 SpeechToText (Credentials credentials)
 
delegate void OnGetModels (ModelSet models, string customData)
 This callback object is used by the GetModels() method. More...
 
bool GetModels (OnGetModels callback, string customData=default(string))
 This function retrieves all the language models that the user may use by setting the RecognizeModel public property. More...
 
delegate void OnGetModel (Model model, string customData)
 This callback object is used by the GetModel() method. More...
 
bool GetModel (OnGetModel callback, string modelID, string customData=default(string))
 This function retrieves a specified languageModel. More...
 
delegate void OnRecognize (SpeechRecognitionEvent results)
 This callback object is used by the Recognize() and StartListening() methods. More...
 
bool StartListening (OnRecognize callback)
 This starts the service listening and it will invoke the callback for any recognized speech. OnListen() must be called by the user to queue audio data to send to the service. StopListening() should be called when you want to stop listening. More...
 
void OnListen (AudioData clip)
 This function should be invoked with the AudioData input after StartListening() method has been invoked. The user should continue to invoke this function until they are ready to call StopListening(), typically microphone input is sent to this function. More...
 
bool StopListening ()
 Invoke this function stop this service from listening. More...
 
bool Recognize (AudioClip clip, OnRecognize callback)
 This function POSTs the given audio clip the recognize function and convert speech into text. This function should be used only on AudioClips under 4MB once they have been converted into WAV format. Use the StartListening() for continuous recognition of text. More...
 
delegate void GetCustomizationsCallback (Customizations customizations, string customData)
 This callback is used by the GetCustomizations() function. More...
 
bool GetCustomizations (GetCustomizationsCallback callback, string language="en-US", string customData=default(string))
 Lists information about all custom language models that are owned by the calling user. Use the language query parameter to see all custom models for the specified language; omit the parameter to see all custom models for all languages. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void CreateCustomizationCallback (CustomizationID customizationID, string customData)
 Thid callback is used by the CreateCustomization() function. More...
 
bool CreateCustomization (CreateCustomizationCallback callback, string name, string base_model_name="en-US_BroadbandModel", string description=default(string), string customData=default(string))
 Creates a new custom language model for a specified base language model. The custom language model can be used only with the base language model for which it is created. The new model is owned by the individual whose service credentials are used to create it. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void OnDeleteCustomizationCallback (bool success, string customData)
 This callback is used by the DeleteCustomization() function. More...
 
bool DeleteCustomization (OnDeleteCustomizationCallback callback, string customizationID, string customData=default(string))
 Deletes an existing custom language model. Only the owner of a custom model can use this method to delete the model. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void GetCustomizationCallback (Customization customization, string customData)
 This callback is used by the GetCusomization() function. More...
 
bool GetCustomization (GetCustomizationCallback callback, string customizationID, string customData=default(string))
 Lists information about a custom language model. Only the owner of a custom model can use this method to query information about the model. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void TrainCustomizationCallback (bool success, string customData)
 This callback is used by the TrainCustomization() function. More...
 
bool TrainCustomization (TrainCustomizationCallback callback, string customizationID, string wordTypeToAdd=WordTypeToAdd.All, string customData=default(string))
 Initiates the training of a custom language model with new corpora, words, or both.After adding training data to the custom model with the corpora or words methods, use this method to begin the actual training of the model on the new data.You can specify whether the custom model is to be trained with all words from its words resources or only with words that were added or modified by the user.Only the owner of a custom model can use this method to train the model. This method is asynchronous and can take on the order of minutes to complete depending on the amount of data on which the service is being trained and the current load on the service.The method returns an HTTP 200 response code to indicate that the training process has begun. You can monitor the status of the training by using the GET /v1/customizations/{customization_id} method to poll the model's status. Use a loop to check the status every 10 seconds. The method returns a Customization object that includes status and progress fields. A status of available means that the custom model is trained and ready to use. If training is in progress, the progress field indicates the progress of the training as a percentage complete. Note: For this beta release, the progress field does not reflect the current progress of the training. The field changes from 0 to 100 when training is complete. Training can fail to start for the following reasons: No training data (corpora or words) have been added to the custom model. Pre-processing of corpora to generate a list of out-of-vocabulary (OOV) words is not complete. Pre-processing of words to validate or auto-generate sounds-like pronunciations is not complete. One or more words that were added to the custom model have invalid sounds-like pronunciations that you must fix. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void ResetCustomizationCallback (bool success, string customData)
 This callback is used by the ResetCustomization() function. More...
 
bool ResetCustomization (ResetCustomizationCallback callback, string customizationID, string customData=default(string))
 Resets a custom language model by removing all corpora and words from the model.Resetting a custom model initializes the model to its state when it was first created. Metadata such as the name and language of the model are preserved.Only the owner of a custom model can use this method to reset the model. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void UpgradeCustomizationCallback (bool success, string customData)
 This callback is used by the UpgradeCustomization() function. More...
 
bool UpgradeCustomization (UpgradeCustomizationCallback callback, string customizationID, string customData=default(string))
 Upgrades a custom language model to the latest release level of the Speech to Text service. The method bases the upgrade on the latest trained data stored for the custom model. If the corpora or words for the model have changed since the model was last trained, you must use the POST /v1/customizations/{customization_id}/train method to train the model on the new data. Only the owner of a custom model can use this method to upgrade the model. Note: This method is not currently implemented.It will be added for a future release of the API. More...
 
delegate void GetCustomCorporaCallback (Corpora corpora, string customData)
 This callback is used by the GetCustomCorpora() function. More...
 
bool GetCustomCorpora (GetCustomCorporaCallback callback, string customizationID, string customData=default(string))
 Lists information about all corpora that have been added to the specified custom language model. The information includes the total number of words and out-of-vocabulary (OOV) words, name, and status of each corpus. Only the owner of a custom model can use this method to list the model's corpora. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void GetCustomCorpusCallback (Corpus corpus, string customData)
 This callback is used by the GetCustomCorpus() function. More...
 
bool GetCustomCorpus (GetCustomCorpusCallback callback, string customizationID, string corpusName, string customData=default(string))
 Lists information about all corpora that have been added to the specified custom language model. The information includes the total number of words and out-of-vocabulary (OOV) words, name, and status of each corpus. Only the owner of a custom model can use this method to list the model's corpora. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void OnDeleteCustomCorpusCallback (bool success, string customData)
 This callback is used by the DeleteCustomCorpus() function. More...
 
bool DeleteCustomCorpus (OnDeleteCustomCorpusCallback callback, string customizationID, string corpusName, string customData=default(string))
 Deletes an existing corpus from a custom language model. The service removes any out-of-vocabulary (OOV) words associated with the corpus from the custom model's words resource unless they were also added by another corpus or they have been modified in some way with the POST /v1/customizations/{customization_id}/words or PUT /v1/customizations/{customization_id}/words/{word_name} method. Removing a corpus does not affect the custom model until you train the model with the POST /v1/customizations/{customization_id}/train method. Only the owner of a custom model can use this method to delete a corpus from the model. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void OnAddCustomCorpusCallback (bool success, string customData)
 This callback is used by the AddCustomCorpus() function. More...
 
bool AddCustomCorpus (OnAddCustomCorpusCallback callback, string customizationID, string corpusName, bool allowOverwrite, string trainingPath, string customData=default(string))
 Adds a single corpus text file of new training data to the custom language model. Use multiple requests to submit multiple corpus text files. Only the owner of a custom model can use this method to add a corpus to the model. Submit a plain text file that contains sample sentences from the domain of interest to enable the service to extract words in context.The more sentences you add that represent the context in which speakers use words from the domain, the better the service's recognition accuracy. Adding a corpus does not affect the custom model until you train the model for the new data by using the POST /v1/customizations/{customization_id}/train method. Use the following guidelines to prepare a corpus text file: More...
 
bool AddCustomCorpus (OnAddCustomCorpusCallback callback, string customizationID, string corpusName, bool allowOverwrite, byte[] trainingData, string customData=default(string))
 Overload method for AddCustomCorpus that takes byteArray training data. More...
 
delegate void GetCustomWordsCallback (WordsList wordList, string customData)
 This callback is used by the GetCustomWords() function. More...
 
bool GetCustomWords (GetCustomWordsCallback callback, string customizationID, string wordType=WordType.All, string customData=default(string))
 Lists information about all custom words from a custom language model. You can list all words from the custom model's words resource, only custom words that were added or modified by the user, or only OOV words that were extracted from corpora. Only the owner of a custom model can use this method to query the words from the model. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void AddCustomWordsCallback (bool success, string customData)
 This callback is used by the AddCustomWords() function. More...
 
bool AddCustomWords (AddCustomWordsCallback callback, string customizationID, bool useDataPath, string wordsJsonPath, string customData=default(string))
 Adds one or more custom words to a custom language model.The service populates the words resource for a custom model with out-of-vocabulary(OOV) words found in each corpus added to the model.You can use this method to add additional words or to modify existing words in the words resource.Only the owner of a custom model can use this method to add or modify custom words associated with the model.Adding or modifying custom words does not affect the custom model until you train the model for the new data by using the POST /v1/customizations/{customization_id}/train method. You add custom words by providing a Words object, which is an array of Word objects, one per word.You must use the object's word parameter to identify the word that is to be added. You can also provide one or both of the optional sounds_like and display_as fields for each word. The sounds_like field provides an array of one or more pronunciations for the word. Use the parameter to specify how the word can be pronounced by users.Use the parameter for words that are difficult to pronounce, foreign words, acronyms, and so on.For example, you might specify that the word IEEE can sound like i triple e.You can specify a maximum of five sounds-like pronunciations for a word, and each pronunciation must adhere to the following rules: Use English alphabetic characters: a-z and A-Z. To pronounce a single letter, use the letter followed by a period, for example, N.C.A.A. for the word NCAA. Use real or made-up words that are pronounceable in the native language, for example, shuchensnie for the word Sczcesny. Substitute equivalent English letters for non-English letters, for example, s for ç or ny for ñ. Substitute non-accented letters for accented letters, for example a for à or e for è. Use the spelling of numbers, for example, seventy-five for 75. You can include multiple words separated by spaces, but the service enforces a maximum of 40 total characters not including spaces. The display_as field provides a different way of spelling the word in a transcript. Use the parameter when you want the word to appear different from its usual representation or from its spelling in corpora training data.For example, you might indicate that the word IBM(trademark) is to be displayed as IBM™. If you add a custom word that already exists in the words resource for the custom model, the new definition overrides the existing data for the word.If the service encounters an error with the input data, it returns a failure code and does not add any of the words to the words resource. The call returns an HTTP 201 response code if the input data is valid.It then asynchronously pre-processes the words to add them to the model's words resource. The time that it takes for the analysis to complete depends on the number of new words that you add but is generally faster than adding a corpus or training a model. You can use the GET /v1/customizations/{ customization_id}/words or GET /v1/customizations/{customization_id}/words/{word_name} method to review the words that you add.Words with an invalid sounds_like field include an error field that describes the problem.You can use other words methods to correct errors, eliminate typos, and modify how words are pronounced as needed. Note: This method is currently a beta release that is available for US English only. More...
 
bool AddCustomWords (AddCustomWordsCallback callback, string customizationID, Words words, string customData=default(string))
 
bool AddCustomWords (AddCustomWordsCallback callback, string customizationID, string wordsJson, string customData=default(string))
 
delegate void OnDeleteCustomWordCallback (bool success, string customData)
 This callback is used by the DeleteCustomWord() function. More...
 
bool DeleteCustomWord (OnDeleteCustomWordCallback callback, string customizationID, string word, string customData=default(string))
 Deletes a custom word from a custom language model. You can remove any word that you added to the custom model's words resource via any means. However, if the word also exists in the service's base vocabulary, the service removes only the custom pronunciation for the word; the word remains in the base vocabulary. Removing a custom word does not affect the custom model until you train the model with the POST /v1/customizations/{customization_id}/train method.Only the owner of a custom model can use this method to delete a word from the model. Note: This method is currently a beta release that is available for US English only. More...
 
delegate void GetCustomWordCallback (WordData word, string customData)
 This callback is used by the GetCustomWord() function. More...
 
bool GetCustomWord (GetCustomWordCallback callback, string customizationID, string word, string customData=default(string))
 Lists information about a custom word from a custom language model. Only the owner of a custom model can use this method to query a word from the model. Note: This method is currently a beta release that is available for US English only. More...
 
string GetServiceID ()
 <exclude> More...
 

Properties

LoadFileDelegate LoadFile [get, set]
 Set this property to overload the internal file loading of this class. More...
 
bool IsListening [get]
 True if StartListening() has been called. More...
 
bool AudioSent [get]
 True if AudioData has been sent and we are recognizing speech. More...
 
ErrorEvent OnError [get, set]
 This delegate is invoked when an error occurs. More...
 
string RecognizeModel [get, set]
 This property controls which recognize model we use when making recognize requests of the server. More...
 
int MaxAlternatives [get, set]
 Returns the maximum number of alternatives returned by recognize. More...
 
bool EnableTimestamps [get, set]
 True to return timestamps of words with results. More...
 
bool EnableWordConfidence [get, set]
 True to return word confidence with results. More...
 
bool EnableContinousRecognition [get, set]
 If true, then we will try to continuously recognize speech. More...
 
bool EnableInterimResults [get, set]
 If true, then we will get interim results while recognizing. The user will then need to check the Final flag on the results. More...
 
bool DetectSilence [get, set]
 If true, then we will try not to send silent audio clips to the server. This can save bandwidth when no sound is happening. More...
 
float SilenceThreshold [get, set]
 A value from 1.0 to 0.0 that determines what is considered silence. If the audio level is below this value then we consider it silence. More...
 
string Url [get, set]
 Gets and sets the endpoint URL for the service. More...
 
Credentials Credentials [get, set]
 Gets and sets the credentials of the service. Replace the default endpoint if endpoint is defined. More...
 
string[] Keywords [get, set]
 NON-MULTIPART ONLY: Array of keyword strings to spot in the audio. Each keyword string can include one or more tokens. Keywords are spotted only in the final hypothesis, not in interim results. Omit the parameter or specify an empty array if you do not need to spot keywords. More...
 
float KeywordsThreshold [get, set]
 NON-MULTIPART ONLY: Confidence value that is the lower bound for spotting a keyword. A word is considered to match a keyword if its confidence is greater than or equal to the threshold. Specify a probability between 0 and 1 inclusive. No keyword spotting is performed if you omit the parameter. If you specify a threshold, you must also specify one or more keywords. More...
 
float WordAlternativesThreshold [get, set]
 NON-MULTIPART ONLY: Confidence value that is the lower bound for identifying a hypothesis as a possible word alternative (also known as "Confusion Networks"). An alternative word is considered if its confidence is greater than or equal to the threshold. Specify a probability between 0 and 1 inclusive. No alternative words are computed if you omit the parameter. More...
 
bool ProfanityFilter [get, set]
 NON-MULTIPART ONLY: If true (the default), filters profanity from all output except for keyword results by replacing inappropriate words with a series of asterisks. Set the parameter to false to return results with no censoring. Applies to US English transcription only. More...
 
bool SmallFormatting [get, set]
 NON-MULTIPART ONLY: If true, converts dates, times, series of digits and numbers, phone numbers, currency values, and Internet addresses into more readable, conventional representations in the final transcript of a recognition request. If false (the default), no formatting is performed. Applies to US English transcription only. More...
 
bool SpeakerLabels [get, set]
 NON-MULTIPART ONLY: Indicates whether labels that identify which words were spoken by which participants in a multi-person exchange are to be included in the response. If true, speaker labels are returned; if false (the default), they are not. Speaker labels can be returned only for the following language models: en-US_NarrowbandModel, en-US_BroadbandModel, es-ES_NarrowbandModel, es-ES_BroadbandModel, ja-JP_NarrowbandModel, and ja-JP_BroadbandModel. Setting speaker_labels to true forces the timestamps parameter to be true, regardless of whether you specify false for the parameter. More...
 

Detailed Description

This class wraps the Watson Speech to Text service. Speech to Text Service

Constructor & Destructor Documentation

IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.SpeechToText ( Credentials  credentials)
inline

Member Function Documentation

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.AddCustomCorpus ( OnAddCustomCorpusCallback  callback,
string  customizationID,
string  corpusName,
bool  allowOverwrite,
string  trainingPath,
string  customData = default(string) 
)
inline

Adds a single corpus text file of new training data to the custom language model. Use multiple requests to submit multiple corpus text files. Only the owner of a custom model can use this method to add a corpus to the model. Submit a plain text file that contains sample sentences from the domain of interest to enable the service to extract words in context.The more sentences you add that represent the context in which speakers use words from the domain, the better the service's recognition accuracy. Adding a corpus does not affect the custom model until you train the model for the new data by using the POST /v1/customizations/{customization_id}/train method. Use the following guidelines to prepare a corpus text file:

  • Provide a plain text file that is encoded in UTF-8 if it contains non-ASCII characters.The service assumes UTF-8 encoding if it encounters such characters.
  • Include each sentence of the corpus on its own line, terminating each line with a carriage return. Including multiple sentences on the same line can degrade accuracy.
  • Use consistent capitalization for words in the corpus. The words resource is case-sensitive; mix upper- and lowercase letters and use capitalization only when intended.
  • Beware of typographical errors.The service assumes that typos are new words; unless you correct them before training the model, the service adds them to the model's vocabulary. The service automatically does the following:
  • Converts numbers to their equivalent words.For example: 500 becomes five hundred and 0.15 becomes zero point fifteen
  • Removes the following punctuation and special characters: ! @ # $ % ^ & * - + = ~ _ . , ; : ( ) < > [ ] { }
  • Ignores phrases enclosed in ( ) (parentheses), < > (angle brackets), [] (square brackets), and { } (curly braces).
  • Converts tokens that include certain symbols to meaningful strings.For example, the service converts a $ (dollar sign) followed by a number to its string representation: $100 becomes one hundred dollars and it converts a % (percent sign) preceded by a number to its string representation: 100% becomes one hundred percent This list is not exhaustive; the service makes similar adjustments for other characters as needed.

The call returns an HTTP 201 response code if the corpus is valid.It then asynchronously pre-processes the contents of the corpus and automatically extracts new words that it finds.This can take on the order of a minute or two to complete depending on the total number of words and the number of new words in the corpus, as well as the current load on the service.You cannot submit requests to add additional corpora or words to the custom model, or to train the model, until the service's analysis of the corpus for the current request completes. Use the GET /v1/customizations/{customization_id}/corpora method to check the status of the analysis.

The service auto-populates the model's words resource with any word that is not found in its base vocabulary; these are referred to as out-of-vocabulary (OOV) words. You can use the GET /v1/customizations/{customization_id}/words method to examine the words resource, using other words method to eliminate typos and modify how words are pronounced as needed.

To add a corpus file that has the same name as an existing corpus, set the allow_overwrite query parameter to true; otherwise, the request fails.Overwriting an existing corpus causes the service to process the corpus text file and extract OOV words anew.Before doing so, it removes any OOV words associated with the existing corpus from the model's words resource unless they were also added by another corpus or they have been modified in some way with the POST /v1/customizations/{customization_id}/words or PUT /v1/customizations/{customization_id}/words/{word_name} method.

The service limits the overall amount of data that you can add to a custom model to a maximum of 10 million total words from all corpora combined.Also, you can add no more than 30 thousand new words to a model; this includes words that the service extracts from corpora and words that you add directly. Note: This method is currently a beta release that is available for US English only

Parameters
callbackThe callback.
customizationIDThe customization ID with the corpus to be deleted.
corpusNameThe corpus name to be deleted.
allowOverwriteAllow overwriting of corpus data.
trainingDataA file path to plain text training data.
customDataOptional customization data.
Returns
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.AddCustomCorpus ( OnAddCustomCorpusCallback  callback,
string  customizationID,
string  corpusName,
bool  allowOverwrite,
byte[]  trainingData,
string  customData = default(string) 
)
inline

Overload method for AddCustomCorpus that takes byteArray training data.

Parameters
callbackThe callback.
customizationIDThe customization ID with the corpus to be deleted.
corpusNameThe corpus name to be deleted.
allowOverwriteAllow overwriting of corpus data.
trainingDataByteArray data for training data.
customDataOptional customization data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.AddCustomWords ( AddCustomWordsCallback  callback,
string  customizationID,
bool  useDataPath,
string  wordsJsonPath,
string  customData = default(string) 
)
inline

Adds one or more custom words to a custom language model.The service populates the words resource for a custom model with out-of-vocabulary(OOV) words found in each corpus added to the model.You can use this method to add additional words or to modify existing words in the words resource.Only the owner of a custom model can use this method to add or modify custom words associated with the model.Adding or modifying custom words does not affect the custom model until you train the model for the new data by using the POST /v1/customizations/{customization_id}/train method. You add custom words by providing a Words object, which is an array of Word objects, one per word.You must use the object's word parameter to identify the word that is to be added. You can also provide one or both of the optional sounds_like and display_as fields for each word. The sounds_like field provides an array of one or more pronunciations for the word. Use the parameter to specify how the word can be pronounced by users.Use the parameter for words that are difficult to pronounce, foreign words, acronyms, and so on.For example, you might specify that the word IEEE can sound like i triple e.You can specify a maximum of five sounds-like pronunciations for a word, and each pronunciation must adhere to the following rules: Use English alphabetic characters: a-z and A-Z. To pronounce a single letter, use the letter followed by a period, for example, N.C.A.A. for the word NCAA. Use real or made-up words that are pronounceable in the native language, for example, shuchensnie for the word Sczcesny. Substitute equivalent English letters for non-English letters, for example, s for ç or ny for ñ. Substitute non-accented letters for accented letters, for example a for à or e for è. Use the spelling of numbers, for example, seventy-five for 75. You can include multiple words separated by spaces, but the service enforces a maximum of 40 total characters not including spaces. The display_as field provides a different way of spelling the word in a transcript. Use the parameter when you want the word to appear different from its usual representation or from its spelling in corpora training data.For example, you might indicate that the word IBM(trademark) is to be displayed as IBM™. If you add a custom word that already exists in the words resource for the custom model, the new definition overrides the existing data for the word.If the service encounters an error with the input data, it returns a failure code and does not add any of the words to the words resource. The call returns an HTTP 201 response code if the input data is valid.It then asynchronously pre-processes the words to add them to the model's words resource. The time that it takes for the analysis to complete depends on the number of new words that you add but is generally faster than adding a corpus or training a model. You can use the GET /v1/customizations/{ customization_id}/words or GET /v1/customizations/{customization_id}/words/{word_name} method to review the words that you add.Words with an invalid sounds_like field include an error field that describes the problem.You can use other words methods to correct errors, eliminate typos, and modify how words are pronounced as needed. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
customizationIDThe requested custom language model's identifier.
useDataPathA boolean used to differentiate overloads with identical input types..
wordsJsonPathA path to a json file to train.
customDataOptional custom data.
Returns
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.AddCustomWords ( AddCustomWordsCallback  callback,
string  customizationID,
Words  words,
string  customData = default(string) 
)
inline
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.AddCustomWords ( AddCustomWordsCallback  callback,
string  customizationID,
string  wordsJson,
string  customData = default(string) 
)
inline
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.AddCustomWordsCallback ( bool  success,
string  customData 
)

This callback is used by the AddCustomWords() function.

Parameters
successThe success of the call.
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.CreateCustomization ( CreateCustomizationCallback  callback,
string  name,
string  base_model_name = "en-US_BroadbandModel",
string  description = default(string),
string  customData = default(string) 
)
inline

Creates a new custom language model for a specified base language model. The custom language model can be used only with the base language model for which it is created. The new model is owned by the individual whose service credentials are used to create it. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
nameThe custom model name.
base_model_nameThe base model name - only en-US_BroadbandModel is currently supported.
descriptionDescripotion of the custom model.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.CreateCustomizationCallback ( CustomizationID  customizationID,
string  customData 
)

Thid callback is used by the CreateCustomization() function.

Parameters
customizationIDThe customizationID.
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.DeleteCustomCorpus ( OnDeleteCustomCorpusCallback  callback,
string  customizationID,
string  corpusName,
string  customData = default(string) 
)
inline

Deletes an existing corpus from a custom language model. The service removes any out-of-vocabulary (OOV) words associated with the corpus from the custom model's words resource unless they were also added by another corpus or they have been modified in some way with the POST /v1/customizations/{customization_id}/words or PUT /v1/customizations/{customization_id}/words/{word_name} method. Removing a corpus does not affect the custom model until you train the model with the POST /v1/customizations/{customization_id}/train method. Only the owner of a custom model can use this method to delete a corpus from the model. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
customizationIDThe customization ID with the corpus to be deleted.
corpusNameThe corpus name to be deleted.
customDataOptional customization data.
Returns
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.DeleteCustomization ( OnDeleteCustomizationCallback  callback,
string  customizationID,
string  customData = default(string) 
)
inline

Deletes an existing custom language model. Only the owner of a custom model can use this method to delete the model. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
customizationIDThe customization ID to be deleted.
customDataOptional customization data.
Returns
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.DeleteCustomWord ( OnDeleteCustomWordCallback  callback,
string  customizationID,
string  word,
string  customData = default(string) 
)
inline

Deletes a custom word from a custom language model. You can remove any word that you added to the custom model's words resource via any means. However, if the word also exists in the service's base vocabulary, the service removes only the custom pronunciation for the word; the word remains in the base vocabulary. Removing a custom word does not affect the custom model until you train the model with the POST /v1/customizations/{customization_id}/train method.Only the owner of a custom model can use this method to delete a word from the model. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
customizationIDThe customization ID to be deleted.
customDataOptional customization data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.ErrorEvent ( string  error)

This callback is used to return errors through the OnError property.

Parameters
errorA string containing the error message.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomCorpora ( GetCustomCorporaCallback  callback,
string  customizationID,
string  customData = default(string) 
)
inline

Lists information about all corpora that have been added to the specified custom language model. The information includes the total number of words and out-of-vocabulary (OOV) words, name, and status of each corpus. Only the owner of a custom model can use this method to list the model's corpora. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
languageThe language for which custom models are to be returned. Currently, only en-US (the default) is supported.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomCorporaCallback ( Corpora  corpora,
string  customData 
)

This callback is used by the GetCustomCorpora() function.

Parameters
corporaThe corpora
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomCorpus ( GetCustomCorpusCallback  callback,
string  customizationID,
string  corpusName,
string  customData = default(string) 
)
inline

Lists information about all corpora that have been added to the specified custom language model. The information includes the total number of words and out-of-vocabulary (OOV) words, name, and status of each corpus. Only the owner of a custom model can use this method to list the model's corpora. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
languageThe language for which custom models are to be returned. Currently, only en-US (the default) is supported.
corpusNameThe name of the custom corpus to be returned.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomCorpusCallback ( Corpus  corpus,
string  customData 
)

This callback is used by the GetCustomCorpus() function.

Parameters
corpusThe corpus
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomization ( GetCustomizationCallback  callback,
string  customizationID,
string  customData = default(string) 
)
inline

Lists information about a custom language model. Only the owner of a custom model can use this method to query information about the model. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
customizationIDThe requested custom language model's identifier.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomizationCallback ( Customization  customization,
string  customData 
)

This callback is used by the GetCusomization() function.

Parameters
customization
customData
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomizations ( GetCustomizationsCallback  callback,
string  language = "en-US",
string  customData = default(string) 
)
inline

Lists information about all custom language models that are owned by the calling user. Use the language query parameter to see all custom models for the specified language; omit the parameter to see all custom models for all languages. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
languageThe language for which custom models are to be returned. Currently, only en-US (the default) is supported.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomizationsCallback ( Customizations  customizations,
string  customData 
)

This callback is used by the GetCustomizations() function.

Parameters
customizationsThe customizations
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomWord ( GetCustomWordCallback  callback,
string  customizationID,
string  word,
string  customData = default(string) 
)
inline

Lists information about a custom word from a custom language model. Only the owner of a custom model can use this method to query a word from the model. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
languageThe language for which custom models are to be returned. Currently, only en-US (the default) is supported.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomWordCallback ( WordData  word,
string  customData 
)

This callback is used by the GetCustomWord() function.

Parameters
wordThe word
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomWords ( GetCustomWordsCallback  callback,
string  customizationID,
string  wordType = WordType.All,
string  customData = default(string) 
)
inline

Lists information about all custom words from a custom language model. You can list all words from the custom model's words resource, only custom words that were added or modified by the user, or only OOV words that were extracted from corpora. Only the owner of a custom model can use this method to query the words from the model. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
languageThe language for which custom models are to be returned. Currently, only en-US (the default) is supported.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetCustomWordsCallback ( WordsList  wordList,
string  customData 
)

This callback is used by the GetCustomWords() function.

Parameters
wordListThe custom words
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetModel ( OnGetModel  callback,
string  modelID,
string  customData = default(string) 
)
inline

This function retrieves a specified languageModel.

Parameters
callbackThis callback is invoked with the requested model. The callback will be invoked with null on error.
modelIDThe name of the model to get.
Returns
Returns true if request has been made.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetModels ( OnGetModels  callback,
string  customData = default(string) 
)
inline

This function retrieves all the language models that the user may use by setting the RecognizeModel public property.

Parameters
callbackThis callback is invoked with an array of all available models. The callback will be invoked with null on error.
customDataCustom string data sent with the call.
Returns
Returns true if request has been made.
string IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.GetServiceID ( )
inline
delegate byte [] IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.LoadFileDelegate ( string  filename)

The delegate for loading a file.

Parameters
filenameThe filename to load.
Returns
Should return a byte array of the file contents or null of failure.
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnAddCustomCorpusCallback ( bool  success,
string  customData 
)

This callback is used by the AddCustomCorpus() function.

Parameters
success
customData
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnDeleteCustomCorpusCallback ( bool  success,
string  customData 
)

This callback is used by the DeleteCustomCorpus() function.

Parameters
success
customData
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnDeleteCustomizationCallback ( bool  success,
string  customData 
)

This callback is used by the DeleteCustomization() function.

Parameters
success
customData
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnDeleteCustomWordCallback ( bool  success,
string  customData 
)

This callback is used by the DeleteCustomWord() function.

Parameters
success
customData
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnGetModel ( Model  model,
string  customData 
)

This callback object is used by the GetModel() method.

Parameters
modelThe resultant model.
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnGetModels ( ModelSet  models,
string  customData 
)

This callback object is used by the GetModels() method.

Parameters
modelsArray of available models.
customDataCustom string data sent with the call.
void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnListen ( AudioData  clip)
inline

This function should be invoked with the AudioData input after StartListening() method has been invoked. The user should continue to invoke this function until they are ready to call StopListening(), typically microphone input is sent to this function.

Parameters
clipA AudioData object containing the AudioClip and max level found in the clip.
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnRecognize ( SpeechRecognitionEvent  results)

This callback object is used by the Recognize() and StartListening() methods.

Parameters
resultsThe ResultList object containing the results.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.Recognize ( AudioClip  clip,
OnRecognize  callback 
)
inline

This function POSTs the given audio clip the recognize function and convert speech into text. This function should be used only on AudioClips under 4MB once they have been converted into WAV format. Use the StartListening() for continuous recognition of text.

Parameters
clipThe AudioClip object.
callbackA callback to invoke with the results.
Returns
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.ResetCustomization ( ResetCustomizationCallback  callback,
string  customizationID,
string  customData = default(string) 
)
inline

Resets a custom language model by removing all corpora and words from the model.Resetting a custom model initializes the model to its state when it was first created. Metadata such as the name and language of the model are preserved.Only the owner of a custom model can use this method to reset the model. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
customizationIDThe requested custom language model's identifier.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.ResetCustomizationCallback ( bool  success,
string  customData 
)

This callback is used by the ResetCustomization() function.

Parameters
successThe success of the call.
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.StartListening ( OnRecognize  callback)
inline

This starts the service listening and it will invoke the callback for any recognized speech. OnListen() must be called by the user to queue audio data to send to the service. StopListening() should be called when you want to stop listening.

Parameters
callbackAll recognize results are passed to this callback.
Returns
Returns true on success, false on failure.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.StopListening ( )
inline

Invoke this function stop this service from listening.

Returns
Returns true on success, false on failure.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.TrainCustomization ( TrainCustomizationCallback  callback,
string  customizationID,
string  wordTypeToAdd = WordTypeToAdd.All,
string  customData = default(string) 
)
inline

Initiates the training of a custom language model with new corpora, words, or both.After adding training data to the custom model with the corpora or words methods, use this method to begin the actual training of the model on the new data.You can specify whether the custom model is to be trained with all words from its words resources or only with words that were added or modified by the user.Only the owner of a custom model can use this method to train the model. This method is asynchronous and can take on the order of minutes to complete depending on the amount of data on which the service is being trained and the current load on the service.The method returns an HTTP 200 response code to indicate that the training process has begun. You can monitor the status of the training by using the GET /v1/customizations/{customization_id} method to poll the model's status. Use a loop to check the status every 10 seconds. The method returns a Customization object that includes status and progress fields. A status of available means that the custom model is trained and ready to use. If training is in progress, the progress field indicates the progress of the training as a percentage complete. Note: For this beta release, the progress field does not reflect the current progress of the training. The field changes from 0 to 100 when training is complete. Training can fail to start for the following reasons: No training data (corpora or words) have been added to the custom model. Pre-processing of corpora to generate a list of out-of-vocabulary (OOV) words is not complete. Pre-processing of words to validate or auto-generate sounds-like pronunciations is not complete. One or more words that were added to the custom model have invalid sounds-like pronunciations that you must fix. Note: This method is currently a beta release that is available for US English only.

Parameters
callbackThe callback.
customizationIDThe requested custom language model's identifier.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.TrainCustomizationCallback ( bool  success,
string  customData 
)

This callback is used by the TrainCustomization() function.

Parameters
successThe success of the call.
customDataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.UpgradeCustomization ( UpgradeCustomizationCallback  callback,
string  customizationID,
string  customData = default(string) 
)
inline

Upgrades a custom language model to the latest release level of the Speech to Text service. The method bases the upgrade on the latest trained data stored for the custom model. If the corpora or words for the model have changed since the model was last trained, you must use the POST /v1/customizations/{customization_id}/train method to train the model on the new data. Only the owner of a custom model can use this method to upgrade the model. Note: This method is not currently implemented.It will be added for a future release of the API.

Parameters
callbackThe callback.
customizationIDThe requested custom language model's identifier.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.UpgradeCustomizationCallback ( bool  success,
string  customData 
)

This callback is used by the UpgradeCustomization() function.

Parameters
successThe success of the call.
customDataOptional custom data.

Property Documentation

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.AudioSent
get

True if AudioData has been sent and we are recognizing speech.

Credentials IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.Credentials
getset

Gets and sets the credentials of the service. Replace the default endpoint if endpoint is defined.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.DetectSilence
getset

If true, then we will try not to send silent audio clips to the server. This can save bandwidth when no sound is happening.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.EnableContinousRecognition
getset

If true, then we will try to continuously recognize speech.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.EnableInterimResults
getset

If true, then we will get interim results while recognizing. The user will then need to check the Final flag on the results.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.EnableTimestamps
getset

True to return timestamps of words with results.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.EnableWordConfidence
getset

True to return word confidence with results.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.IsListening
get

True if StartListening() has been called.

string [] IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.Keywords
getset

NON-MULTIPART ONLY: Array of keyword strings to spot in the audio. Each keyword string can include one or more tokens. Keywords are spotted only in the final hypothesis, not in interim results. Omit the parameter or specify an empty array if you do not need to spot keywords.

float IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.KeywordsThreshold
getset

NON-MULTIPART ONLY: Confidence value that is the lower bound for spotting a keyword. A word is considered to match a keyword if its confidence is greater than or equal to the threshold. Specify a probability between 0 and 1 inclusive. No keyword spotting is performed if you omit the parameter. If you specify a threshold, you must also specify one or more keywords.

LoadFileDelegate IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.LoadFile
getset

Set this property to overload the internal file loading of this class.

int IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.MaxAlternatives
getset

Returns the maximum number of alternatives returned by recognize.

ErrorEvent IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.OnError
getset

This delegate is invoked when an error occurs.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.ProfanityFilter
getset

NON-MULTIPART ONLY: If true (the default), filters profanity from all output except for keyword results by replacing inappropriate words with a series of asterisks. Set the parameter to false to return results with no censoring. Applies to US English transcription only.

string IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.RecognizeModel
getset

This property controls which recognize model we use when making recognize requests of the server.

float IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.SilenceThreshold
getset

A value from 1.0 to 0.0 that determines what is considered silence. If the audio level is below this value then we consider it silence.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.SmallFormatting
getset

NON-MULTIPART ONLY: If true, converts dates, times, series of digits and numbers, phone numbers, currency values, and Internet addresses into more readable, conventional representations in the final transcript of a recognition request. If false (the default), no formatting is performed. Applies to US English transcription only.

bool IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.SpeakerLabels
getset

NON-MULTIPART ONLY: Indicates whether labels that identify which words were spoken by which participants in a multi-person exchange are to be included in the response. If true, speaker labels are returned; if false (the default), they are not. Speaker labels can be returned only for the following language models: en-US_NarrowbandModel, en-US_BroadbandModel, es-ES_NarrowbandModel, es-ES_BroadbandModel, ja-JP_NarrowbandModel, and ja-JP_BroadbandModel. Setting speaker_labels to true forces the timestamps parameter to be true, regardless of whether you specify false for the parameter.

string IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.Url
getset

Gets and sets the endpoint URL for the service.

float IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText.WordAlternativesThreshold
getset

NON-MULTIPART ONLY: Confidence value that is the lower bound for identifying a hypothesis as a possible word alternative (also known as "Confusion Networks"). An alternative word is considered if its confidence is greater than or equal to the threshold. Specify a probability between 0 and 1 inclusive. No alternative words are computed if you omit the parameter.


The documentation for this class was generated from the following file: