ibm_watson 1.4.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +43 -6
- data/lib/ibm_watson/assistant_v1.rb +213 -195
- data/lib/ibm_watson/assistant_v2.rb +221 -20
- data/lib/ibm_watson/compare_comply_v1.rb +35 -21
- data/lib/ibm_watson/discovery_v1.rb +132 -13
- data/lib/ibm_watson/discovery_v2.rb +734 -21
- data/lib/ibm_watson/language_translator_v3.rb +205 -67
- data/lib/ibm_watson/natural_language_classifier_v1.rb +4 -2
- data/lib/ibm_watson/natural_language_understanding_v1.rb +21 -21
- data/lib/ibm_watson/personality_insights_v3.rb +27 -18
- data/lib/ibm_watson/speech_to_text_v1.rb +65 -53
- data/lib/ibm_watson/text_to_speech_v1.rb +124 -140
- data/lib/ibm_watson/tone_analyzer_v3.rb +12 -13
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +33 -16
- data/lib/ibm_watson/visual_recognition_v4.rb +103 -17
- data/test/integration/test_assistant_v1.rb +9 -0
- data/test/integration/test_assistant_v2.rb +34 -0
- data/test/integration/test_discovery_v2.rb +132 -6
- data/test/integration/test_language_translator_v3.rb +5 -0
- data/test/integration/test_text_to_speech_v1.rb +3 -3
- data/test/integration/test_visual_recognition_v4.rb +9 -0
- data/test/unit/test_assistant_v1.rb +150 -99
- data/test/unit/test_assistant_v2.rb +153 -8
- data/test/unit/test_compare_comply_v1.rb +20 -20
- data/test/unit/test_discovery_v1.rb +125 -125
- data/test/unit/test_discovery_v2.rb +262 -29
- data/test/unit/test_language_translator_v3.rb +85 -24
- data/test/unit/test_natural_language_classifier_v1.rb +17 -17
- data/test/unit/test_natural_language_understanding_v1.rb +10 -10
- data/test/unit/test_personality_insights_v3.rb +14 -14
- data/test/unit/test_speech_to_text_v1.rb +97 -97
- data/test/unit/test_text_to_speech_v1.rb +48 -48
- data/test/unit/test_tone_analyzer_v3.rb +12 -12
- data/test/unit/test_visual_recognition_v3.rb +16 -16
- data/test/unit/test_visual_recognition_v4.rb +56 -38
- metadata +8 -7
@@ -13,12 +13,25 @@
|
|
13
13
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
|
-
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
16
|
+
#
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
|
18
|
+
#
|
19
|
+
# IBM® will begin sunsetting IBM Watson™ Personality Insights on 1 December
|
20
|
+
# 2020. For a period of one year from this date, you will still be able to use Watson
|
21
|
+
# Personality Insights. However, as of 1 December 2021, the offering will no longer be
|
22
|
+
# available.<br/><br/>As an alternative, we encourage you to consider migrating to IBM
|
23
|
+
# Watson™ Natural Language Understanding, a service on IBM Cloud® that uses deep
|
24
|
+
# learning to extract data and insights from text such as keywords, categories, sentiment,
|
25
|
+
# emotion, and syntax to provide insights for your business or industry. For more
|
26
|
+
# information, see [About Natural Language
|
27
|
+
# Understanding](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about).
|
28
|
+
# {: deprecated}
|
29
|
+
#
|
30
|
+
# The IBM Watson Personality Insights service enables applications to derive insights from
|
31
|
+
# social media, enterprise data, or other digital communications. The service uses
|
32
|
+
# linguistic analytics to infer individuals' intrinsic personality characteristics,
|
33
|
+
# including Big Five, Needs, and Values, from digital communications such as email, text
|
34
|
+
# messages, tweets, and forum posts.
|
22
35
|
#
|
23
36
|
# The service can automatically infer, from potentially noisy social media, portraits of
|
24
37
|
# individuals that reflect their personality characteristics. The service can infer
|
@@ -48,34 +61,28 @@ module IBMWatson
|
|
48
61
|
class PersonalityInsightsV3 < IBMCloudSdkCore::BaseService
|
49
62
|
include Concurrent::Async
|
50
63
|
DEFAULT_SERVICE_NAME = "personality_insights"
|
51
|
-
DEFAULT_SERVICE_URL = "https://
|
64
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.personality-insights.watson.cloud.ibm.com"
|
65
|
+
attr_accessor :version
|
52
66
|
##
|
53
67
|
# @!method initialize(args)
|
54
68
|
# Construct a new client for the Personality Insights service.
|
55
69
|
#
|
56
70
|
# @param args [Hash] The args to initialize with
|
57
|
-
# @option args version [String]
|
58
|
-
#
|
59
|
-
# incompatible way, a new minor version of the API is released.
|
60
|
-
# The service uses the API version for the date you specify, or
|
61
|
-
# the most recent version before that date. Note that you should
|
62
|
-
# not programmatically specify the current date at runtime, in
|
63
|
-
# case the API has been updated since your application's release.
|
64
|
-
# Instead, specify a version date that is compatible with your
|
65
|
-
# application, and don't change it until your application is
|
66
|
-
# ready for a later version.
|
71
|
+
# @option args version [String] Release date of the version of the API you want to use. Specify dates in
|
72
|
+
# YYYY-MM-DD format. The current version is `2017-10-13`.
|
67
73
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
68
74
|
# The base service_url may differ between IBM Cloud regions.
|
69
75
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
70
76
|
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
71
77
|
# any external configuration, if applicable.
|
72
78
|
def initialize(args = {})
|
79
|
+
warn "On 1 December 2021, Personality Insights will no longer be available. For more information, see https://github.com/watson-developer-cloud/ruby-sdk/tree/master#personality-insights-deprecation."
|
73
80
|
@__async_initialized__ = false
|
74
81
|
defaults = {}
|
75
|
-
defaults[:version] = nil
|
76
82
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
77
83
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
78
84
|
defaults[:authenticator] = nil
|
85
|
+
defaults[:version] = nil
|
79
86
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
80
87
|
args = defaults.merge(args)
|
81
88
|
@version = args[:version]
|
@@ -170,6 +177,8 @@ module IBMWatson
|
|
170
177
|
# default, no consumption preferences are returned.
|
171
178
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
172
179
|
def profile(content:, accept:, content_type: nil, content_language: nil, accept_language: nil, raw_scores: nil, csv_headers: nil, consumption_preferences: nil)
|
180
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
181
|
+
|
173
182
|
raise ArgumentError.new("content must be provided") if content.nil?
|
174
183
|
|
175
184
|
raise ArgumentError.new("accept must be provided") if accept.nil?
|
@@ -13,13 +13,15 @@
|
|
13
13
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
|
-
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
16
|
+
#
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
|
18
|
+
#
|
19
|
+
# The IBM Watson™ Speech to Text service provides APIs that use IBM's
|
20
|
+
# speech-recognition capabilities to produce transcripts of spoken audio. The service can
|
21
|
+
# transcribe speech from various languages and audio formats. In addition to basic
|
22
|
+
# transcription, the service can produce detailed information about many different aspects
|
23
|
+
# of the audio. For most languages, the service supports two sampling rates, broadband and
|
24
|
+
# narrowband. It returns all JSON response content in the UTF-8 character set.
|
23
25
|
#
|
24
26
|
# For speech recognition, the service supports synchronous and asynchronous HTTP
|
25
27
|
# Representational State Transfer (REST) interfaces. It also supports a WebSocket
|
@@ -51,7 +53,7 @@ module IBMWatson
|
|
51
53
|
class SpeechToTextV1 < IBMCloudSdkCore::BaseService
|
52
54
|
include Concurrent::Async
|
53
55
|
DEFAULT_SERVICE_NAME = "speech_to_text"
|
54
|
-
DEFAULT_SERVICE_URL = "https://
|
56
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.speech-to-text.watson.cloud.ibm.com"
|
55
57
|
##
|
56
58
|
# @!method initialize(args)
|
57
59
|
# Construct a new client for the Speech to Text service.
|
@@ -84,7 +86,8 @@ module IBMWatson
|
|
84
86
|
# List models.
|
85
87
|
# Lists all language models that are available for use with the service. The
|
86
88
|
# information includes the name of the model and its minimum sampling rate in Hertz,
|
87
|
-
# among other things.
|
89
|
+
# among other things. The ordering of the list of models can change from call to
|
90
|
+
# call; do not rely on an alphabetized or static list of models.
|
88
91
|
#
|
89
92
|
# **See also:** [Languages and
|
90
93
|
# models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#models).
|
@@ -229,7 +232,7 @@ module IBMWatson
|
|
229
232
|
#
|
230
233
|
# **See also:** [Making a multipart HTTP
|
231
234
|
# request](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-http#HTTP-multi).
|
232
|
-
# @param audio [
|
235
|
+
# @param audio [File] The audio to transcribe.
|
233
236
|
# @param content_type [String] The format (MIME type) of the audio. For more information about specifying an
|
234
237
|
# audio format, see **Audio formats (content types)** in the method description.
|
235
238
|
# @param model [String] The identifier of the model that is to be used for the recognition request. See
|
@@ -335,11 +338,9 @@ module IBMWatson
|
|
335
338
|
# parameter to be `true`, regardless of whether you specify `false` for the
|
336
339
|
# parameter.
|
337
340
|
#
|
338
|
-
# **Note:** Applies to US English, German, Japanese, Korean, and
|
339
|
-
# broadband and narrowband models) and UK English (narrowband model)
|
340
|
-
# only.
|
341
|
-
# use the **Get a model** method and check that the attribute `speaker_labels` is
|
342
|
-
# set to `true`.
|
341
|
+
# **Note:** Applies to US English, Australian English, German, Japanese, Korean, and
|
342
|
+
# Spanish (both broadband and narrowband models) and UK English (narrowband model)
|
343
|
+
# transcription only.
|
343
344
|
#
|
344
345
|
# See [Speaker
|
345
346
|
# labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#speaker_labels).
|
@@ -488,7 +489,7 @@ module IBMWatson
|
|
488
489
|
# @param customization_id [String] The GUID of a custom language model that is to be used with the request. The base model of the specified custom language model must match the model specified with the `model` parameter. You must make the request with service credentials created for the instance of the service that owns the custom model. By default, no custom language model is used.
|
489
490
|
# @param acoustic_customization_id [String] The GUID of a custom acoustic model that is to be used with the request. The base model of the specified custom acoustic model must match the model specified with the `model` parameter. You must make the request with service credentials created for the instance of the service that owns the custom model. By default, no custom acoustic model is used.
|
490
491
|
# @param language_customization_id [String] The GUID of a custom language model that is to be used with the request. The base model of the specified custom language model must match the model specified with the `model` parameter. You must make the request with service credentials created for the instance of the service that owns the custom model. By default, no custom language model is used.
|
491
|
-
# @param base_model_version [String] The version of the specified base `model` that is to be used for speech recognition. Multiple versions of a base model can exist when a model is updated for internal improvements. The parameter is intended primarily for use with custom models that have been upgraded for a new base model. The default value depends on whether the parameter is used with or without a custom model. For more information, see [Base model version](https://
|
492
|
+
# @param base_model_version [String] The version of the specified base `model` that is to be used for speech recognition. Multiple versions of a base model can exist when a model is updated for internal improvements. The parameter is intended primarily for use with custom models that have been upgraded for a new base model. The default value depends on whether the parameter is used with or without a custom model. For more information, see [Base model version](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#version).
|
492
493
|
# @param inactivity_timeout [Integer] The time in seconds after which, if only silence (no speech) is detected in submitted audio, the connection is closed with a 400 error. Useful for stopping audio submission from a live microphone when a user simply walks away. Use `-1` for infinity.
|
493
494
|
# @param interim_results [Boolean] Send back non-final previews of each "sentence" as it is being processed. These results are ignored in text mode.
|
494
495
|
# @param keywords [Array<String>] 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. If you specify any keywords, you must also specify a keywords threshold. Omit the parameter or specify an empty array if you do not need to spot keywords.
|
@@ -499,13 +500,13 @@ module IBMWatson
|
|
499
500
|
# @param timestamps [Boolean] If `true`, time alignment for each word is returned.
|
500
501
|
# @param profanity_filter [Boolean] 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.
|
501
502
|
# @param smart_formatting [Boolean] 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.
|
502
|
-
# @param speaker_labels [Boolean] Indicates whether labels that identify which words were spoken by which participants in a multi-person exchange are to be included in the response. The default is `false`; no speaker labels are returned. Setting `speaker_labels` to `true` forces the `timestamps` parameter to be `true`, regardless of whether you specify `false` for the parameter. To determine whether a language model supports speaker labels, use the `GET /v1/models` method and check that the attribute `speaker_labels` is set to `true`. You can also refer to [Speaker labels](https://
|
503
|
+
# @param speaker_labels [Boolean] Indicates whether labels that identify which words were spoken by which participants in a multi-person exchange are to be included in the response. The default is `false`; no speaker labels are returned. Setting `speaker_labels` to `true` forces the `timestamps` parameter to be `true`, regardless of whether you specify `false` for the parameter. To determine whether a language model supports speaker labels, use the `GET /v1/models` method and check that the attribute `speaker_labels` is set to `true`. You can also refer to [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#speaker_labels).
|
503
504
|
# @param grammar_name [String] The name of a grammar that is to be used with the recognition request. If you
|
504
505
|
# specify a grammar, you must also use the `language_customization_id` parameter to
|
505
506
|
# specify the name of the custom language model for which the grammar is defined.
|
506
507
|
# The service recognizes only strings that are recognized by the specified grammar;
|
507
508
|
# it does not recognize other custom words from the model's words resource. See
|
508
|
-
# [Grammars](https://cloud.ibm.com/docs/
|
509
|
+
# [Grammars](https://cloud.ibm.com/docs/speech-to-text/output.html).
|
509
510
|
# @param redaction [Boolean] If `true`, the service redacts, or masks, numeric data from final transcripts. The
|
510
511
|
# feature redacts any number that has three or more consecutive digits by replacing
|
511
512
|
# each digit with an `X` character. It is intended to redact sensitive numeric data,
|
@@ -520,7 +521,7 @@ module IBMWatson
|
|
520
521
|
# **Note:** Applies to US English, Japanese, and Korean transcription only.
|
521
522
|
#
|
522
523
|
# See [Numeric
|
523
|
-
# redaction](https://cloud.ibm.com/docs/
|
524
|
+
# redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#redaction).
|
524
525
|
#
|
525
526
|
# @param processing_metrics [Boolean] If `true`, requests processing metrics about the service's transcription of the
|
526
527
|
# input audio. The service returns processing metrics at the interval specified by
|
@@ -542,7 +543,7 @@ module IBMWatson
|
|
542
543
|
# @return [WebSocketClient] Returns a new WebSocketClient object
|
543
544
|
#
|
544
545
|
# See [Audio
|
545
|
-
# metrics](https://cloud.ibm.com/docs/
|
546
|
+
# metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics#audio_metrics).
|
546
547
|
# @param end_of_phrase_silence_time [Float] If `true`, specifies the duration of the pause interval at which the service
|
547
548
|
# splits a transcript into multiple final results. If the service detects pauses or
|
548
549
|
# extended silence before it reaches the end of the audio stream, its response can
|
@@ -559,7 +560,7 @@ module IBMWatson
|
|
559
560
|
# Chinese is 0.6 seconds.
|
560
561
|
#
|
561
562
|
# See [End of phrase silence
|
562
|
-
# time](https://cloud.ibm.com/docs/
|
563
|
+
# time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#silence_time).
|
563
564
|
# @param split_transcript_at_phrase_end [Boolean] If `true`, directs the service to split the transcript into multiple final results
|
564
565
|
# based on semantic features of the input, for example, at the conclusion of
|
565
566
|
# meaningful phrases such as sentences. The service bases its understanding of
|
@@ -569,7 +570,7 @@ module IBMWatson
|
|
569
570
|
# interval.
|
570
571
|
#
|
571
572
|
# See [Split transcript at phrase
|
572
|
-
# end](https://cloud.ibm.com/docs/
|
573
|
+
# end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#split_transcript).
|
573
574
|
# @param speech_detector_sensitivity [Float] The sensitivity of speech activity detection that the service is to perform. Use
|
574
575
|
# the parameter to suppress word insertions from music, coughing, and other
|
575
576
|
# non-speech events. The service biases the audio it passes for speech recognition
|
@@ -681,9 +682,9 @@ module IBMWatson
|
|
681
682
|
# @!method register_callback(callback_url:, user_secret: nil)
|
682
683
|
# Register a callback.
|
683
684
|
# Registers a callback URL with the service for use with subsequent asynchronous
|
684
|
-
# recognition requests. The service attempts to register, or
|
685
|
-
#
|
686
|
-
#
|
685
|
+
# recognition requests. The service attempts to register, or allowlist, the callback
|
686
|
+
# URL if it is not already registered by sending a `GET` request to the callback
|
687
|
+
# URL. The service passes a random alphanumeric challenge string via the
|
687
688
|
# `challenge_string` parameter of the request. The request includes an `Accept`
|
688
689
|
# header that specifies `text/plain` as the required response type.
|
689
690
|
#
|
@@ -695,9 +696,9 @@ module IBMWatson
|
|
695
696
|
#
|
696
697
|
# The service sends only a single `GET` request to the callback URL. If the service
|
697
698
|
# does not receive a reply with a response code of 200 and a body that echoes the
|
698
|
-
# challenge string sent by the service within five seconds, it does not
|
699
|
+
# challenge string sent by the service within five seconds, it does not allowlist
|
699
700
|
# the URL; it instead sends status code 400 in response to the **Register a
|
700
|
-
# callback** request. If the requested callback URL is already
|
701
|
+
# callback** request. If the requested callback URL is already allowlisted, the
|
701
702
|
# service responds to the initial registration request with response code 200.
|
702
703
|
#
|
703
704
|
# If you specify a user secret with the request, the service uses it as a key to
|
@@ -715,7 +716,7 @@ module IBMWatson
|
|
715
716
|
# **See also:** [Registering a callback
|
716
717
|
# URL](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-async#register).
|
717
718
|
# @param callback_url [String] An HTTP or HTTPS URL to which callback notifications are to be sent. To be
|
718
|
-
#
|
719
|
+
# allowlisted, the URL must successfully echo the challenge string during URL
|
719
720
|
# verification. During verification, the client can also check the signature that
|
720
721
|
# the service sends in the `X-Callback-Signature` header to verify the origin of the
|
721
722
|
# request.
|
@@ -753,7 +754,7 @@ module IBMWatson
|
|
753
754
|
##
|
754
755
|
# @!method unregister_callback(callback_url:)
|
755
756
|
# Unregister a callback.
|
756
|
-
# Unregisters a callback URL that was previously
|
757
|
+
# Unregisters a callback URL that was previously allowlisted with a **Register a
|
757
758
|
# callback** request for use with the asynchronous interface. Once unregistered, the
|
758
759
|
# URL can no longer be used with asynchronous recognition requests.
|
759
760
|
#
|
@@ -884,14 +885,14 @@ module IBMWatson
|
|
884
885
|
#
|
885
886
|
# **See also:** [Audio
|
886
887
|
# formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-formats#audio-formats).
|
887
|
-
# @param audio [
|
888
|
+
# @param audio [File] The audio to transcribe.
|
888
889
|
# @param content_type [String] The format (MIME type) of the audio. For more information about specifying an
|
889
890
|
# audio format, see **Audio formats (content types)** in the method description.
|
890
891
|
# @param model [String] The identifier of the model that is to be used for the recognition request. See
|
891
892
|
# [Languages and
|
892
893
|
# models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#models).
|
893
894
|
# @param callback_url [String] A URL to which callback notifications are to be sent. The URL must already be
|
894
|
-
# successfully
|
895
|
+
# successfully allowlisted by using the **Register a callback** method. You can
|
895
896
|
# include the same callback URL with any number of job creation requests. Omit the
|
896
897
|
# parameter to poll the service for job completion and results.
|
897
898
|
#
|
@@ -1024,11 +1025,9 @@ module IBMWatson
|
|
1024
1025
|
# parameter to be `true`, regardless of whether you specify `false` for the
|
1025
1026
|
# parameter.
|
1026
1027
|
#
|
1027
|
-
# **Note:** Applies to US English, German, Japanese, Korean, and
|
1028
|
-
# broadband and narrowband models) and UK English (narrowband model)
|
1029
|
-
# only.
|
1030
|
-
# use the **Get a model** method and check that the attribute `speaker_labels` is
|
1031
|
-
# set to `true`.
|
1028
|
+
# **Note:** Applies to US English, Australian English, German, Japanese, Korean, and
|
1029
|
+
# Spanish (both broadband and narrowband models) and UK English (narrowband model)
|
1030
|
+
# transcription only.
|
1032
1031
|
#
|
1033
1032
|
# See [Speaker
|
1034
1033
|
# labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#speaker_labels).
|
@@ -1393,8 +1392,12 @@ module IBMWatson
|
|
1393
1392
|
# **See also:** [Listing custom language
|
1394
1393
|
# models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLanguageModels#listModels-language).
|
1395
1394
|
# @param language [String] The identifier of the language for which custom language or custom acoustic models
|
1396
|
-
# are to be returned
|
1397
|
-
#
|
1395
|
+
# are to be returned. Omit the parameter to see all custom language or custom
|
1396
|
+
# acoustic models that are owned by the requesting credentials.
|
1397
|
+
#
|
1398
|
+
# To determine the languages for which customization is available, see [Language
|
1399
|
+
# support for
|
1400
|
+
# customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customization#languageSupport).
|
1398
1401
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
1399
1402
|
def list_language_models(language: nil)
|
1400
1403
|
headers = {
|
@@ -2513,8 +2516,12 @@ module IBMWatson
|
|
2513
2516
|
# **See also:** [Listing custom acoustic
|
2514
2517
|
# models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAcousticModels#listModels-acoustic).
|
2515
2518
|
# @param language [String] The identifier of the language for which custom language or custom acoustic models
|
2516
|
-
# are to be returned
|
2517
|
-
#
|
2519
|
+
# are to be returned. Omit the parameter to see all custom language or custom
|
2520
|
+
# acoustic models that are owned by the requesting credentials.
|
2521
|
+
#
|
2522
|
+
# To determine the languages for which customization is available, see [Language
|
2523
|
+
# support for
|
2524
|
+
# customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customization#languageSupport).
|
2518
2525
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
2519
2526
|
def list_acoustic_models(language: nil)
|
2520
2527
|
headers = {
|
@@ -2612,14 +2619,14 @@ module IBMWatson
|
|
2612
2619
|
# it. You must use credentials for the instance of the service that owns a model to
|
2613
2620
|
# train it.
|
2614
2621
|
#
|
2615
|
-
# The training method is asynchronous.
|
2616
|
-
#
|
2617
|
-
#
|
2618
|
-
# training a custom acoustic model takes
|
2619
|
-
#
|
2620
|
-
#
|
2621
|
-
# returns an HTTP 200 response code to indicate that the training
|
2622
|
-
#
|
2622
|
+
# The training method is asynchronous. Training time depends on the cumulative
|
2623
|
+
# amount of audio data that the custom acoustic model contains and the current load
|
2624
|
+
# on the service. When you train or retrain a model, the service uses all of the
|
2625
|
+
# model's audio data in the training. Training a custom acoustic model takes
|
2626
|
+
# approximately as long as the length of its cumulative audio data. For example, it
|
2627
|
+
# takes approximately 2 hours to train a model that contains a total of 2 hours of
|
2628
|
+
# audio. The method returns an HTTP 200 response code to indicate that the training
|
2629
|
+
# process has begun.
|
2623
2630
|
#
|
2624
2631
|
# You can monitor the status of the training by using the **Get a custom acoustic
|
2625
2632
|
# model** method to poll the model's status. Use a loop to check the status once a
|
@@ -2963,7 +2970,7 @@ module IBMWatson
|
|
2963
2970
|
# used, their use is strongly discouraged.)
|
2964
2971
|
# * Do not use the name of an audio resource that has already been added to the
|
2965
2972
|
# custom model.
|
2966
|
-
# @param audio_resource [
|
2973
|
+
# @param audio_resource [File] The audio resource that is to be added to the custom acoustic model, an individual
|
2967
2974
|
# audio file or an archive file.
|
2968
2975
|
#
|
2969
2976
|
# With the `curl` command, use the `--data-binary` option to upload the file for the
|
@@ -3131,10 +3138,15 @@ module IBMWatson
|
|
3131
3138
|
# deletes all data for the customer ID, regardless of the method by which the
|
3132
3139
|
# information was added. The method has no effect if no data is associated with the
|
3133
3140
|
# customer ID. You must issue the request with credentials for the same instance of
|
3134
|
-
# the service that was used to associate the customer ID with the data.
|
3135
|
-
#
|
3136
|
-
#
|
3137
|
-
#
|
3141
|
+
# the service that was used to associate the customer ID with the data. You
|
3142
|
+
# associate a customer ID with data by passing the `X-Watson-Metadata` header with a
|
3143
|
+
# request that passes the data.
|
3144
|
+
#
|
3145
|
+
# **Note:** If you delete an instance of the service from the service console, all
|
3146
|
+
# data associated with that service instance is automatically deleted. This includes
|
3147
|
+
# all custom language models, corpora, grammars, and words; all custom acoustic
|
3148
|
+
# models and audio resources; all registered endpoints for the asynchronous HTTP
|
3149
|
+
# interface; and all data related to speech recognition requests.
|
3138
3150
|
#
|
3139
3151
|
# **See also:** [Information
|
3140
3152
|
# security](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-information-security#information-security).
|
@@ -13,25 +13,28 @@
|
|
13
13
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
|
-
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
16
|
+
#
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
|
18
|
+
#
|
19
|
+
# The IBM Watson™ Text to Speech service provides APIs that use IBM's
|
20
|
+
# speech-synthesis capabilities to synthesize text into natural-sounding speech in a
|
21
|
+
# variety of languages, dialects, and voices. The service supports at least one male or
|
22
|
+
# female voice, sometimes both, for each language. The audio is streamed back to the
|
23
|
+
# client with minimal delay.
|
21
24
|
#
|
22
25
|
# For speech synthesis, the service supports a synchronous HTTP Representational State
|
23
|
-
# Transfer (REST) interface
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
26
|
+
# Transfer (REST) interface and a WebSocket interface. Both interfaces support plain text
|
27
|
+
# and SSML input. SSML is an XML-based markup language that provides text annotation for
|
28
|
+
# speech-synthesis applications. The WebSocket interface also supports the SSML
|
29
|
+
# <code><mark></code> element and word timings.
|
27
30
|
#
|
28
|
-
# The service
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
31
|
+
# The service offers a customization interface that you can use to define sounds-like or
|
32
|
+
# phonetic translations for words. A sounds-like translation consists of one or more words
|
33
|
+
# that, when combined, sound like the word. A phonetic translation is based on the SSML
|
34
|
+
# phoneme format for representing a word. You can specify a phonetic translation in
|
35
|
+
# standard International Phonetic Alphabet (IPA) representation or in the proprietary IBM
|
36
|
+
# Symbolic Phonetic Representation (SPR). The Arabic, Chinese, Dutch, and Korean languages
|
37
|
+
# support only IPA.
|
35
38
|
|
36
39
|
require "concurrent"
|
37
40
|
require "erb"
|
@@ -46,7 +49,7 @@ module IBMWatson
|
|
46
49
|
class TextToSpeechV1 < IBMCloudSdkCore::BaseService
|
47
50
|
include Concurrent::Async
|
48
51
|
DEFAULT_SERVICE_NAME = "text_to_speech"
|
49
|
-
DEFAULT_SERVICE_URL = "https://
|
52
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.text-to-speech.watson.cloud.ibm.com"
|
50
53
|
##
|
51
54
|
# @!method initialize(args)
|
52
55
|
# Construct a new client for the Text to Speech service.
|
@@ -78,8 +81,10 @@ module IBMWatson
|
|
78
81
|
# @!method list_voices
|
79
82
|
# List voices.
|
80
83
|
# Lists all voices available for use with the service. The information includes the
|
81
|
-
# name, language, gender, and other details about the voice.
|
82
|
-
#
|
84
|
+
# name, language, gender, and other details about the voice. The ordering of the
|
85
|
+
# list of voices can change from call to call; do not rely on an alphabetized or
|
86
|
+
# static list of voices. To see information about a specific voice, use the **Get a
|
87
|
+
# voice** method.
|
83
88
|
#
|
84
89
|
# **See also:** [Listing all available
|
85
90
|
# voices](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices#listVoices).
|
@@ -106,14 +111,14 @@ module IBMWatson
|
|
106
111
|
# Get a voice.
|
107
112
|
# Gets information about the specified voice. The information includes the name,
|
108
113
|
# language, gender, and other details about the voice. Specify a customization ID to
|
109
|
-
# obtain information for a custom
|
110
|
-
#
|
111
|
-
#
|
114
|
+
# obtain information for a custom model that is defined for the language of the
|
115
|
+
# specified voice. To list information about all available voices, use the **List
|
116
|
+
# voices** method.
|
112
117
|
#
|
113
118
|
# **See also:** [Listing a specific
|
114
119
|
# voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices#listVoice).
|
115
120
|
# @param voice [String] The voice for which information is to be returned.
|
116
|
-
# @param customization_id [String] The customization ID (GUID) of a custom
|
121
|
+
# @param customization_id [String] The customization ID (GUID) of a custom model for which information is to be
|
117
122
|
# returned. You must make the request with credentials for the instance of the
|
118
123
|
# service that owns the custom model. Omit the parameter to see information about
|
119
124
|
# the specified voice with no customization.
|
@@ -222,8 +227,8 @@ module IBMWatson
|
|
222
227
|
# specifying an audio format, see **Audio formats (accept types)** in the method
|
223
228
|
# description.
|
224
229
|
# @param voice [String] The voice to use for synthesis.
|
225
|
-
# @param customization_id [String] The customization ID (GUID) of a custom
|
226
|
-
# custom
|
230
|
+
# @param customization_id [String] The customization ID (GUID) of a custom model to use for the synthesis. If a
|
231
|
+
# custom model is specified, it works only if it matches the language of the
|
227
232
|
# indicated voice. You must make the request with credentials for the instance of
|
228
233
|
# the service that owns the custom model. Omit the parameter to use the specified
|
229
234
|
# voice with no customization.
|
@@ -268,9 +273,7 @@ module IBMWatson
|
|
268
273
|
# Gets the phonetic pronunciation for the specified word. You can request the
|
269
274
|
# pronunciation for a specific format. You can also request the pronunciation for a
|
270
275
|
# specific voice to see the default translation for the language of that voice or
|
271
|
-
# for a specific custom
|
272
|
-
#
|
273
|
-
# **Note:** This method is currently a beta release.
|
276
|
+
# for a specific custom model to see the translation for that model.
|
274
277
|
#
|
275
278
|
# **See also:** [Querying a word from a
|
276
279
|
# language](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordsQueryLanguage).
|
@@ -281,13 +284,13 @@ module IBMWatson
|
|
281
284
|
# @param format [String] The phoneme format in which to return the pronunciation. The Arabic, Chinese,
|
282
285
|
# Dutch, and Korean languages support only IPA. Omit the parameter to obtain the
|
283
286
|
# pronunciation in the default format.
|
284
|
-
# @param customization_id [String] The customization ID (GUID) of a custom
|
285
|
-
#
|
286
|
-
#
|
287
|
-
#
|
288
|
-
#
|
289
|
-
#
|
290
|
-
#
|
287
|
+
# @param customization_id [String] The customization ID (GUID) of a custom model for which the pronunciation is to be
|
288
|
+
# returned. The language of a specified custom model must match the language of the
|
289
|
+
# specified voice. If the word is not defined in the specified custom model, the
|
290
|
+
# service returns the default translation for the custom model's language. You must
|
291
|
+
# make the request with credentials for the instance of the service that owns the
|
292
|
+
# custom model. Omit the parameter to see the translation for the specified voice
|
293
|
+
# with no customization.
|
291
294
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
292
295
|
def get_pronunciation(text:, voice: nil, format: nil, customization_id: nil)
|
293
296
|
raise ArgumentError.new("text must be provided") if text.nil?
|
@@ -320,31 +323,28 @@ module IBMWatson
|
|
320
323
|
#########################
|
321
324
|
|
322
325
|
##
|
323
|
-
# @!method
|
326
|
+
# @!method create_custom_model(name:, language: nil, description: nil)
|
324
327
|
# Create a custom model.
|
325
|
-
# Creates a new empty custom
|
328
|
+
# Creates a new empty custom model. You must specify a name for the new custom
|
326
329
|
# model. You can optionally specify the language and a description for the new
|
327
330
|
# model. The model is owned by the instance of the service whose credentials are
|
328
331
|
# used to create it.
|
329
332
|
#
|
330
|
-
# **Note:** This method is currently a beta release.
|
331
|
-
#
|
332
333
|
# **See also:** [Creating a custom
|
333
334
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsCreate).
|
334
|
-
# @param name [String] The name of the new custom
|
335
|
-
# @param language [String] The language of the new custom
|
336
|
-
#
|
337
|
-
#
|
338
|
-
#
|
339
|
-
# @param description [String] A description of the new custom
|
340
|
-
# recommended.
|
335
|
+
# @param name [String] The name of the new custom model.
|
336
|
+
# @param language [String] The language of the new custom model. You create a custom model for a specific
|
337
|
+
# language, not for a specific voice. A custom model can be used with any voice,
|
338
|
+
# standard or neural, for its specified language. Omit the parameter to use the the
|
339
|
+
# default language, `en-US`.
|
340
|
+
# @param description [String] A description of the new custom model. Specifying a description is recommended.
|
341
341
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
342
|
-
def
|
342
|
+
def create_custom_model(name:, language: nil, description: nil)
|
343
343
|
raise ArgumentError.new("name must be provided") if name.nil?
|
344
344
|
|
345
345
|
headers = {
|
346
346
|
}
|
347
|
-
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "
|
347
|
+
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "create_custom_model")
|
348
348
|
headers.merge!(sdk_headers)
|
349
349
|
|
350
350
|
data = {
|
@@ -366,27 +366,25 @@ module IBMWatson
|
|
366
366
|
end
|
367
367
|
|
368
368
|
##
|
369
|
-
# @!method
|
369
|
+
# @!method list_custom_models(language: nil)
|
370
370
|
# List custom models.
|
371
|
-
# Lists metadata such as the name and description for all custom
|
372
|
-
#
|
373
|
-
#
|
374
|
-
# specific
|
371
|
+
# Lists metadata such as the name and description for all custom models that are
|
372
|
+
# owned by an instance of the service. Specify a language to list the custom models
|
373
|
+
# for that language only. To see the words in addition to the metadata for a
|
374
|
+
# specific custom model, use the **List a custom model** method. You must use
|
375
375
|
# credentials for the instance of the service that owns a model to list information
|
376
376
|
# about it.
|
377
377
|
#
|
378
|
-
# **Note:** This method is currently a beta release.
|
379
|
-
#
|
380
378
|
# **See also:** [Querying all custom
|
381
379
|
# models](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsQueryAll).
|
382
|
-
# @param language [String] The language for which custom
|
383
|
-
#
|
384
|
-
#
|
380
|
+
# @param language [String] The language for which custom models that are owned by the requesting credentials
|
381
|
+
# are to be returned. Omit the parameter to see all custom models that are owned by
|
382
|
+
# the requester.
|
385
383
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
386
|
-
def
|
384
|
+
def list_custom_models(language: nil)
|
387
385
|
headers = {
|
388
386
|
}
|
389
|
-
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "
|
387
|
+
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "list_custom_models")
|
390
388
|
headers.merge!(sdk_headers)
|
391
389
|
|
392
390
|
params = {
|
@@ -406,14 +404,14 @@ module IBMWatson
|
|
406
404
|
end
|
407
405
|
|
408
406
|
##
|
409
|
-
# @!method
|
407
|
+
# @!method update_custom_model(customization_id:, name: nil, description: nil, words: nil)
|
410
408
|
# Update a custom model.
|
411
|
-
# Updates information for the specified custom
|
412
|
-
#
|
413
|
-
#
|
414
|
-
#
|
415
|
-
#
|
416
|
-
#
|
409
|
+
# Updates information for the specified custom model. You can update metadata such
|
410
|
+
# as the name and description of the model. You can also update the words in the
|
411
|
+
# model and their translations. Adding a new translation for a word that already
|
412
|
+
# exists in a custom model overwrites the word's existing translation. A custom
|
413
|
+
# model can contain no more than 20,000 entries. You must use credentials for the
|
414
|
+
# instance of the service that owns a model to update it.
|
417
415
|
#
|
418
416
|
# You can define sounds-like or phonetic translations for words. A sounds-like
|
419
417
|
# translation consists of one or more words that, when combined, sound like the
|
@@ -429,8 +427,6 @@ module IBMWatson
|
|
429
427
|
# <code><phoneme alphabet="ibm"
|
430
428
|
# ph="1gAstroEntxrYFXs"></phoneme></code>
|
431
429
|
#
|
432
|
-
# **Note:** This method is currently a beta release.
|
433
|
-
#
|
434
430
|
# **See also:**
|
435
431
|
# * [Updating a custom
|
436
432
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsUpdate)
|
@@ -438,20 +434,20 @@ module IBMWatson
|
|
438
434
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
|
439
435
|
# * [Understanding
|
440
436
|
# customization](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customIntro#customIntro).
|
441
|
-
# @param customization_id [String] The customization ID (GUID) of the custom
|
442
|
-
#
|
443
|
-
# @param name [String] A new name for the custom
|
444
|
-
# @param description [String] A new description for the custom
|
437
|
+
# @param customization_id [String] The customization ID (GUID) of the custom model. You must make the request with
|
438
|
+
# credentials for the instance of the service that owns the custom model.
|
439
|
+
# @param name [String] A new name for the custom model.
|
440
|
+
# @param description [String] A new description for the custom model.
|
445
441
|
# @param words [Array[Word]] An array of `Word` objects that provides the words and their translations that are
|
446
|
-
# to be added or updated for the custom
|
442
|
+
# to be added or updated for the custom model. Pass an empty array to make no
|
447
443
|
# additions or updates.
|
448
444
|
# @return [nil]
|
449
|
-
def
|
445
|
+
def update_custom_model(customization_id:, name: nil, description: nil, words: nil)
|
450
446
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
451
447
|
|
452
448
|
headers = {
|
453
449
|
}
|
454
|
-
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "
|
450
|
+
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "update_custom_model")
|
455
451
|
headers.merge!(sdk_headers)
|
456
452
|
|
457
453
|
data = {
|
@@ -473,26 +469,24 @@ module IBMWatson
|
|
473
469
|
end
|
474
470
|
|
475
471
|
##
|
476
|
-
# @!method
|
472
|
+
# @!method get_custom_model(customization_id:)
|
477
473
|
# Get a custom model.
|
478
|
-
# Gets all information about a specified custom
|
479
|
-
#
|
480
|
-
#
|
481
|
-
#
|
482
|
-
#
|
483
|
-
# **Note:** This method is currently a beta release.
|
474
|
+
# Gets all information about a specified custom model. In addition to metadata such
|
475
|
+
# as the name and description of the custom model, the output includes the words and
|
476
|
+
# their translations as defined in the model. To see just the metadata for a model,
|
477
|
+
# use the **List custom models** method.
|
484
478
|
#
|
485
479
|
# **See also:** [Querying a custom
|
486
480
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsQuery).
|
487
|
-
# @param customization_id [String] The customization ID (GUID) of the custom
|
488
|
-
#
|
481
|
+
# @param customization_id [String] The customization ID (GUID) of the custom model. You must make the request with
|
482
|
+
# credentials for the instance of the service that owns the custom model.
|
489
483
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
490
|
-
def
|
484
|
+
def get_custom_model(customization_id:)
|
491
485
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
492
486
|
|
493
487
|
headers = {
|
494
488
|
}
|
495
|
-
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "
|
489
|
+
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "get_custom_model")
|
496
490
|
headers.merge!(sdk_headers)
|
497
491
|
|
498
492
|
method_url = "/v1/customizations/%s" % [ERB::Util.url_encode(customization_id)]
|
@@ -507,24 +501,22 @@ module IBMWatson
|
|
507
501
|
end
|
508
502
|
|
509
503
|
##
|
510
|
-
# @!method
|
504
|
+
# @!method delete_custom_model(customization_id:)
|
511
505
|
# Delete a custom model.
|
512
|
-
# Deletes the specified custom
|
513
|
-
#
|
514
|
-
#
|
515
|
-
# **Note:** This method is currently a beta release.
|
506
|
+
# Deletes the specified custom model. You must use credentials for the instance of
|
507
|
+
# the service that owns a model to delete it.
|
516
508
|
#
|
517
509
|
# **See also:** [Deleting a custom
|
518
510
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsDelete).
|
519
|
-
# @param customization_id [String] The customization ID (GUID) of the custom
|
520
|
-
#
|
511
|
+
# @param customization_id [String] The customization ID (GUID) of the custom model. You must make the request with
|
512
|
+
# credentials for the instance of the service that owns the custom model.
|
521
513
|
# @return [nil]
|
522
|
-
def
|
514
|
+
def delete_custom_model(customization_id:)
|
523
515
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
524
516
|
|
525
517
|
headers = {
|
526
518
|
}
|
527
|
-
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "
|
519
|
+
sdk_headers = Common.new.get_sdk_headers("text_to_speech", "V1", "delete_custom_model")
|
528
520
|
headers.merge!(sdk_headers)
|
529
521
|
|
530
522
|
method_url = "/v1/customizations/%s" % [ERB::Util.url_encode(customization_id)]
|
@@ -544,7 +536,7 @@ module IBMWatson
|
|
544
536
|
##
|
545
537
|
# @!method add_words(customization_id:, words:)
|
546
538
|
# Add custom words.
|
547
|
-
# Adds one or more words and their translations to the specified custom
|
539
|
+
# Adds one or more words and their translations to the specified custom model.
|
548
540
|
# Adding a new translation for a word that already exists in a custom model
|
549
541
|
# overwrites the word's existing translation. A custom model can contain no more
|
550
542
|
# than 20,000 entries. You must use credentials for the instance of the service that
|
@@ -564,8 +556,6 @@ module IBMWatson
|
|
564
556
|
# <code><phoneme alphabet="ibm"
|
565
557
|
# ph="1gAstroEntxrYFXs"></phoneme></code>
|
566
558
|
#
|
567
|
-
# **Note:** This method is currently a beta release.
|
568
|
-
#
|
569
559
|
# **See also:**
|
570
560
|
# * [Adding multiple words to a custom
|
571
561
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordsAdd)
|
@@ -573,15 +563,15 @@ module IBMWatson
|
|
573
563
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
|
574
564
|
# * [Understanding
|
575
565
|
# customization](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customIntro#customIntro).
|
576
|
-
# @param customization_id [String] The customization ID (GUID) of the custom
|
577
|
-
#
|
566
|
+
# @param customization_id [String] The customization ID (GUID) of the custom model. You must make the request with
|
567
|
+
# credentials for the instance of the service that owns the custom model.
|
578
568
|
# @param words [Array[Word]] The **Add custom words** method accepts an array of `Word` objects. Each object
|
579
|
-
# provides a word that is to be added or updated for the custom
|
580
|
-
#
|
569
|
+
# provides a word that is to be added or updated for the custom model and the word's
|
570
|
+
# translation.
|
581
571
|
#
|
582
572
|
# The **List custom words** method returns an array of `Word` objects. Each object
|
583
|
-
# shows a word and its translation from the custom
|
584
|
-
#
|
573
|
+
# shows a word and its translation from the custom model. The words are listed in
|
574
|
+
# alphabetical order, with uppercase letters listed before lowercase letters. The
|
585
575
|
# array is empty if the custom model contains no words.
|
586
576
|
# @return [nil]
|
587
577
|
def add_words(customization_id:, words:)
|
@@ -613,17 +603,14 @@ module IBMWatson
|
|
613
603
|
##
|
614
604
|
# @!method list_words(customization_id:)
|
615
605
|
# List custom words.
|
616
|
-
# Lists all of the words and their translations for the specified custom
|
617
|
-
#
|
618
|
-
#
|
619
|
-
# words.
|
620
|
-
#
|
621
|
-
# **Note:** This method is currently a beta release.
|
606
|
+
# Lists all of the words and their translations for the specified custom model. The
|
607
|
+
# output shows the translations as they are defined in the model. You must use
|
608
|
+
# credentials for the instance of the service that owns a model to list its words.
|
622
609
|
#
|
623
610
|
# **See also:** [Querying all words from a custom
|
624
611
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordsQueryModel).
|
625
|
-
# @param customization_id [String] The customization ID (GUID) of the custom
|
626
|
-
#
|
612
|
+
# @param customization_id [String] The customization ID (GUID) of the custom model. You must make the request with
|
613
|
+
# credentials for the instance of the service that owns the custom model.
|
627
614
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
628
615
|
def list_words(customization_id:)
|
629
616
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
@@ -647,11 +634,11 @@ module IBMWatson
|
|
647
634
|
##
|
648
635
|
# @!method add_word(customization_id:, word:, translation:, part_of_speech: nil)
|
649
636
|
# Add a custom word.
|
650
|
-
# Adds a single word and its translation to the specified custom
|
651
|
-
#
|
652
|
-
#
|
653
|
-
#
|
654
|
-
#
|
637
|
+
# Adds a single word and its translation to the specified custom model. Adding a new
|
638
|
+
# translation for a word that already exists in a custom model overwrites the word's
|
639
|
+
# existing translation. A custom model can contain no more than 20,000 entries. You
|
640
|
+
# must use credentials for the instance of the service that owns a model to add a
|
641
|
+
# word to it.
|
655
642
|
#
|
656
643
|
# You can define sounds-like or phonetic translations for words. A sounds-like
|
657
644
|
# translation consists of one or more words that, when combined, sound like the
|
@@ -667,8 +654,6 @@ module IBMWatson
|
|
667
654
|
# <code><phoneme alphabet="ibm"
|
668
655
|
# ph="1gAstroEntxrYFXs"></phoneme></code>
|
669
656
|
#
|
670
|
-
# **Note:** This method is currently a beta release.
|
671
|
-
#
|
672
657
|
# **See also:**
|
673
658
|
# * [Adding a single word to a custom
|
674
659
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordAdd)
|
@@ -676,9 +661,9 @@ module IBMWatson
|
|
676
661
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
|
677
662
|
# * [Understanding
|
678
663
|
# customization](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customIntro#customIntro).
|
679
|
-
# @param customization_id [String] The customization ID (GUID) of the custom
|
680
|
-
#
|
681
|
-
# @param word [String] The word that is to be added or updated for the custom
|
664
|
+
# @param customization_id [String] The customization ID (GUID) of the custom model. You must make the request with
|
665
|
+
# credentials for the instance of the service that owns the custom model.
|
666
|
+
# @param word [String] The word that is to be added or updated for the custom model.
|
682
667
|
# @param translation [String] The phonetic or sounds-like translation for the word. A phonetic translation is
|
683
668
|
# based on the SSML format for representing the phonetic string of a word either as
|
684
669
|
# an IPA translation or as an IBM SPR translation. The Arabic, Chinese, Dutch, and
|
@@ -727,13 +712,11 @@ module IBMWatson
|
|
727
712
|
# shows the translation as it is defined in the model. You must use credentials for
|
728
713
|
# the instance of the service that owns a model to list its words.
|
729
714
|
#
|
730
|
-
# **Note:** This method is currently a beta release.
|
731
|
-
#
|
732
715
|
# **See also:** [Querying a single word from a custom
|
733
716
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordQueryModel).
|
734
|
-
# @param customization_id [String] The customization ID (GUID) of the custom
|
735
|
-
#
|
736
|
-
# @param word [String] The word that is to be queried from the custom
|
717
|
+
# @param customization_id [String] The customization ID (GUID) of the custom model. You must make the request with
|
718
|
+
# credentials for the instance of the service that owns the custom model.
|
719
|
+
# @param word [String] The word that is to be queried from the custom model.
|
737
720
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
738
721
|
def get_word(customization_id:, word:)
|
739
722
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
@@ -759,17 +742,14 @@ module IBMWatson
|
|
759
742
|
##
|
760
743
|
# @!method delete_word(customization_id:, word:)
|
761
744
|
# Delete a custom word.
|
762
|
-
# Deletes a single word from the specified custom
|
763
|
-
#
|
764
|
-
#
|
765
|
-
#
|
766
|
-
# **Note:** This method is currently a beta release.
|
745
|
+
# Deletes a single word from the specified custom model. You must use credentials
|
746
|
+
# for the instance of the service that owns a model to delete its words.
|
767
747
|
#
|
768
748
|
# **See also:** [Deleting a word from a custom
|
769
749
|
# model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordDelete).
|
770
|
-
# @param customization_id [String] The customization ID (GUID) of the custom
|
771
|
-
#
|
772
|
-
# @param word [String] The word that is to be deleted from the custom
|
750
|
+
# @param customization_id [String] The customization ID (GUID) of the custom model. You must make the request with
|
751
|
+
# credentials for the instance of the service that owns the custom model.
|
752
|
+
# @param word [String] The word that is to be deleted from the custom model.
|
773
753
|
# @return [nil]
|
774
754
|
def delete_word(customization_id:, word:)
|
775
755
|
raise ArgumentError.new("customization_id must be provided") if customization_id.nil?
|
@@ -802,10 +782,14 @@ module IBMWatson
|
|
802
782
|
# deletes all data for the customer ID, regardless of the method by which the
|
803
783
|
# information was added. The method has no effect if no data is associated with the
|
804
784
|
# customer ID. You must issue the request with credentials for the same instance of
|
805
|
-
# the service that was used to associate the customer ID with the data.
|
806
|
-
#
|
807
|
-
#
|
808
|
-
#
|
785
|
+
# the service that was used to associate the customer ID with the data. You
|
786
|
+
# associate a customer ID with data by passing the `X-Watson-Metadata` header with a
|
787
|
+
# request that passes the data.
|
788
|
+
#
|
789
|
+
# **Note:** If you delete an instance of the service from the service console, all
|
790
|
+
# data associated with that service instance is automatically deleted. This includes
|
791
|
+
# all custom models and word/translation pairs, and all data related to speech
|
792
|
+
# synthesis requests.
|
809
793
|
#
|
810
794
|
# **See also:** [Information
|
811
795
|
# security](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-information-security#information-security).
|