Assets/Watson/Scripts/Services/SpeechToText/SpeechToText.cs
/// <summary>
/// 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.
/// </summary>
/// <param name="callback">The callback.</param>
/// <param name="customizationID">The requested custom language model's identifier.</param>
/// <param name="customData">Optional custom data.</param>
/// <returns></returns>
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.
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 .
public bool TrainCustomization(TrainCustomizationCallback callback, string customizationID, string wordTypeToAdd = WordTypeToAdd.ALL, string customData = default(string))
		{
			if (callback == null)
				throw new ArgumentNullException("callback");
			if (string.IsNullOrEmpty(customizationID))
				throw new ArgumentNullException("A customizationID to train a custom language model.");
			TrainCustomizationRequest req = new TrainCustomizationRequest();
			req.Callback = callback;
			req.CustomizationID = customizationID;
			req.Data = customData;
			req.Parameters["word_type_to_add"] = wordTypeToAdd;
			req.Headers["Content-Type"] = "application/json";
			req.Headers["Accept"] = "application/json";
			req.Send = Encoding.UTF8.GetBytes("{}");
			req.OnResponse = OnTrainCustomizationResp;
			string service = "/v1/customizations/{0}/train";
			RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, string.Format(service, customizationID));
			if (connector == null)
				return false;
			return connector.Send(req);
		}
public bool TrainCustomization ( TrainCustomizationCallback callback , string customizationID , string wordTypeToAdd = WordTypeToAdd . ALL , string customData = default ( string ) ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( customizationID ) ) throw new ArgumentNullException ( " " ) ; TrainCustomizationRequest req = new TrainCustomizationRequest ( ) ; req . Callback = callback ; req . CustomizationID = customizationID ; req . Data = customData ; req . Parameters [ " " ] = wordTypeToAdd ; req . Headers [ " " ] = " " ; req . Headers [ " " ] = " " ; req . Send = Encoding . UTF8 . GetBytes ( " " ) ; req . OnResponse = OnTrainCustomizationResp ; string service = " " ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , string . Format ( service , customizationID ) ) ; if ( connector == null ) return false ; return connector . Send ( req ) ; }
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.
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 .
None
callback
TrainCustomizationCallback
None
customizationID
string
The requested custom language model's identifier.
The requested custom language model ' s identifier .
wordTypeToAdd
string
customData
string
Optional custom data.
Optional custom data .