Assets/Watson/Scripts/Services/SpeechToText/SpeechToText.cs
/// <summary>
/// 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.
/// </summary>
/// <param name="callback">The callback.</param>
/// <param name="name">The custom model name.</param>
/// <param name="base_model_name">The base model name - only en-US_BroadbandModel is currently supported.</param>
/// <param name="description">Descripotion of the custom model.</param>
/// <param name="customData">Optional custom data.</param>
/// <returns></returns>
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.
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 .
public bool CreateCustomization(CreateCustomizationCallback callback, string name, string base_model_name = "en-US_BroadbandModel", string description = default(string), string customData = default(string))
		{
			if (callback == null)
				throw new ArgumentNullException("callback");
			if (string.IsNullOrEmpty(name))
				throw new ArgumentNullException("A name is required to create a custom language model.");
			CustomLanguage customLanguage = new CustomLanguage();
			customLanguage.name = name;
			customLanguage.base_model_name = base_model_name;
			customLanguage.description = string.IsNullOrEmpty(description) ? name : description;
			fsData data;
			sm_Serializer.TrySerialize(customLanguage.GetType(), customLanguage, out data).AssertSuccessWithoutWarnings();
			string customizationJson = fsJsonPrinter.CompressedJson(data);
			CreateCustomizationRequest req = new CreateCustomizationRequest();
			req.Callback = callback;
			req.CustomLanguage = customLanguage;
			req.Data = customData;
			req.Headers["Content-Type"] = "application/json";
			req.Headers["Accept"] = "application/json";
			req.Send = Encoding.UTF8.GetBytes(customizationJson);
			req.OnResponse = OnCreateCustomizationResp;
			RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, "/v1/customizations");
			if (connector == null)
				return false;
			return connector.Send(req);
		}
public bool CreateCustomization ( CreateCustomizationCallback callback , string name , string base_model_name = " " , string description = default ( string ) , string customData = default ( string ) ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( name ) ) throw new ArgumentNullException ( " " ) ; CustomLanguage customLanguage = new CustomLanguage ( ) ; customLanguage . name = name ; customLanguage . base_model_name = base_model_name ; customLanguage . description = string . IsNullOrEmpty ( description ) ? name : description ; fsData data ; sm_Serializer . TrySerialize ( customLanguage . GetType ( ) , customLanguage , out data ) . AssertSuccessWithoutWarnings ( ) ; string customizationJson = fsJsonPrinter . CompressedJson ( data ) ; CreateCustomizationRequest req = new CreateCustomizationRequest ( ) ; req . Callback = callback ; req . CustomLanguage = customLanguage ; req . Data = customData ; req . Headers [ " " ] = " " ; req . Headers [ " " ] = " " ; req . Send = Encoding . UTF8 . GetBytes ( customizationJson ) ; req . OnResponse = OnCreateCustomizationResp ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , " " ) ; if ( connector == null ) return false ; return connector . Send ( req ) ; }
Creates a new custom language model for a specified base language model.
Creates a new custom language model for a specified base language model .
None
callback
CreateCustomizationCallback
None
name
string
The custom model name.
The custom model name .
base_model_name
string
The base model name - only en-US_BroadbandModel is currently supported.
The base model name - only en - US_BroadbandModel is currently supported .
description
string
Descripotion of the custom model.
Descripotion of the custom model .
customData
string
Optional custom data.
Optional custom data .