ibm_watson 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae8370e694afb3c9bc5904e6cf9156e329c46569e531953bd5de499d8e06d069
4
- data.tar.gz: 07a2a51577402b7a908996e3e536d7085bfd4e3fbb1e854bff24902d71d085c9
3
+ metadata.gz: 7c6d7f5a377f215adb0729cf0382278e5ffaab799600af790f34ccbdfc23c9bc
4
+ data.tar.gz: 2bcd42b40f431dd384e98ed4bb2189f31bc9f2e3079d3e6f99616c04dac0058e
5
5
  SHA512:
6
- metadata.gz: 12746df4ba137cda554cfb8fcd7f313bfc7a355f2f258a86a39d3d6824f06e9e7e30947c22b846bc811d3bafadb8e7e1cdb4e916209fe76b44c74358fa1f6c75
7
- data.tar.gz: 9942822349a390ebe594b4905f1148b0a21aa6eac12de531c6505aee9e43d00a5cdb16a3a18ad71b87bc75625987ff35ee2c1d92f06a11123da797b5d3a6f254
6
+ metadata.gz: 0c596c85d58113d53c16e02d146efd8a8dcad0e182b09b5be788cd0f407270b8cdb74dc367cfd970843d29bd698e94123769322da23c35a044426b8a6e039cef
7
+ data.tar.gz: c36a5db2c61384052d8d1df6cbacaae5eec21a8acf6050c8bb3bf7eac419ccb60b34028b870d4b88845e0750698c1bb0dc08e04730265a6c30066c138428d3b6
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -2306,6 +2306,9 @@ module IBMWatson
2306
2306
  # with a request that passes data. For more information about personal data and
2307
2307
  # customer IDs, see [Information
2308
2308
  # security](https://cloud.ibm.com/docs/services/assistant?topic=assistant-information-security#information-security).
2309
+ #
2310
+ # This operation is limited to 4 requests per minute. For more information, see
2311
+ # **Rate limiting**.
2309
2312
  # @param customer_id [String] The customer ID for which all data is to be deleted.
2310
2313
  # @return [nil]
2311
2314
  def delete_user_data(customer_id:)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -631,6 +631,8 @@ module IBMWatson
631
631
 
632
632
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
633
633
 
634
+ raise ArgumentError.new("name must be provided") if name.nil?
635
+
634
636
  headers = {
635
637
  }
636
638
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "update_collection")
@@ -1590,6 +1592,8 @@ module IBMWatson
1590
1592
  def federated_query(environment_id:, collection_ids:, filter: nil, query: nil, natural_language_query: nil, passages: nil, aggregation: nil, count: nil, _return: nil, offset: nil, sort: nil, highlight: nil, passages_fields: nil, passages_count: nil, passages_characters: nil, deduplicate: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil, bias: nil, x_watson_logging_opt_out: nil)
1591
1593
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1592
1594
 
1595
+ raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
1596
+
1593
1597
  headers = {
1594
1598
  "X-Watson-Logging-Opt-Out" => x_watson_logging_opt_out
1595
1599
  }
@@ -2216,7 +2220,7 @@ module IBMWatson
2216
2220
  # Create event.
2217
2221
  # The **Events** API can be used to create log entries that are associated with
2218
2222
  # specific queries. For example, you can record which documents in the results set
2219
- # were "clicked" by a user and when that click occured.
2223
+ # were "clicked" by a user and when that click occurred.
2220
2224
  # @param type [String] The event type to be created.
2221
2225
  # @param data [EventData] Query event data object.
2222
2226
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -387,14 +387,14 @@ module IBMWatson
387
387
  # **_/v2/projects/{project_id}/collections/{collection_id}/documents** method.
388
388
  #
389
389
  # **Note:** This operation only works on collections created to accept direct file
390
- # uploads. It cannot be used to modify a collection that conects to an external
390
+ # uploads. It cannot be used to modify a collection that connects to an external
391
391
  # source such as Microsoft SharePoint.
392
392
  # @param project_id [String] The ID of the project. This information can be found from the deploy page of the
393
393
  # Discovery administrative tooling.
394
394
  # @param collection_id [String] The ID of the collection.
395
395
  # @param file [File] The content of the document to ingest. The maximum supported file size when adding
396
396
  # a file to a collection is 50 megabytes, the maximum supported file size when
397
- # testing a confiruration is 1 megabyte. Files larger than the supported size are
397
+ # testing a configuration is 1 megabyte. Files larger than the supported size are
398
398
  # rejected.
399
399
  # @param filename [String] The filename for file.
400
400
  # @param file_content_type [String] The content type of file.
@@ -459,7 +459,7 @@ module IBMWatson
459
459
  # any document stored with the same **document_id** if it exists.
460
460
  #
461
461
  # **Note:** This operation only works on collections created to accept direct file
462
- # uploads. It cannot be used to modify a collection that conects to an external
462
+ # uploads. It cannot be used to modify a collection that connects to an external
463
463
  # source such as Microsoft SharePoint.
464
464
  # @param project_id [String] The ID of the project. This information can be found from the deploy page of the
465
465
  # Discovery administrative tooling.
@@ -467,7 +467,7 @@ module IBMWatson
467
467
  # @param document_id [String] The ID of the document.
468
468
  # @param file [File] The content of the document to ingest. The maximum supported file size when adding
469
469
  # a file to a collection is 50 megabytes, the maximum supported file size when
470
- # testing a confiruration is 1 megabyte. Files larger than the supported size are
470
+ # testing a configuration is 1 megabyte. Files larger than the supported size are
471
471
  # rejected.
472
472
  # @param filename [String] The filename for file.
473
473
  # @param file_content_type [String] The content type of file.
@@ -529,7 +529,7 @@ module IBMWatson
529
529
  # 'deleted'.
530
530
  #
531
531
  # **Note:** This operation only works on collections created to accept direct file
532
- # uploads. It cannot be used to modify a collection that conects to an external
532
+ # uploads. It cannot be used to modify a collection that connects to an external
533
533
  # source such as Microsoft SharePoint.
534
534
  # @param project_id [String] The ID of the project. This information can be found from the deploy page of the
535
535
  # Discovery administrative tooling.
@@ -647,6 +647,10 @@ module IBMWatson
647
647
  def create_training_query(project_id:, natural_language_query:, examples:, filter: nil)
648
648
  raise ArgumentError.new("project_id must be provided") if project_id.nil?
649
649
 
650
+ raise ArgumentError.new("natural_language_query must be provided") if natural_language_query.nil?
651
+
652
+ raise ArgumentError.new("examples must be provided") if examples.nil?
653
+
650
654
  headers = {
651
655
  }
652
656
  sdk_headers = Common.new.get_sdk_headers("discovery", "V2", "create_training_query")
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -391,7 +391,7 @@ module IBMWatson
391
391
  # Submit a document for translation. You can submit the document contents in the
392
392
  # `file` parameter, or you can reference a previously submitted document by document
393
393
  # ID.
394
- # @param file [File] The source file to translate.
394
+ # @param file [File] The contents of the source file to translate.
395
395
  #
396
396
  # [Supported file
397
397
  # types](https://cloud.ibm.com/docs/services/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
21
21
  #
22
22
  # You can create [custom
23
23
  # models](https://cloud.ibm.com/docs/services/natural-language-understanding?topic=natural-language-understanding-customizing)
24
- # with Watson Knowledge Studio to detect custom entities, relations, and categories in
25
- # Natural Language Understanding.
24
+ # with Watson Knowledge Studio to detect custom entities and relations in Natural Language
25
+ # Understanding.
26
26
 
27
27
  require "concurrent"
28
28
  require "erb"
@@ -87,6 +87,10 @@ module IBMWatson
87
87
  # - Semantic roles
88
88
  # - Sentiment
89
89
  # - Syntax (Experimental).
90
+ #
91
+ # If a language for the input text is not specified with the `language` parameter,
92
+ # the service [automatically detects the
93
+ # language](https://cloud.ibm.com/docs/services/natural-language-understanding?topic=natural-language-understanding-detectable-languages).
90
94
  # @param features [Features] Specific features to analyze the document for.
91
95
  # @param text [String] The plain text to analyze. One of the `text`, `html`, or `url` parameters is
92
96
  # required.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -135,7 +135,7 @@ module IBMWatson
135
135
  #########################
136
136
 
137
137
  ##
138
- # @!method recognize(audio:, content_type: nil, model: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil, audio_metrics: nil)
138
+ # @!method recognize(audio:, content_type: nil, model: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil, audio_metrics: nil, end_of_phrase_silence_time: nil, split_transcript_at_phrase_end: nil)
139
139
  # Recognize audio.
140
140
  # Sends audio and returns transcription results for a recognition request. You can
141
141
  # pass a maximum of 100 MB and a minimum of 100 bytes of audio with a request. The
@@ -358,8 +358,38 @@ module IBMWatson
358
358
  # @param audio_metrics [Boolean] If `true`, requests detailed information about the signal characteristics of the
359
359
  # input audio. The service returns audio metrics with the final transcription
360
360
  # results. By default, the service returns no audio metrics.
361
+ #
362
+ # See [Audio
363
+ # metrics](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-metrics#audio_metrics).
364
+ # @param end_of_phrase_silence_time [Float] If `true`, specifies the duration of the pause interval at which the service
365
+ # splits a transcript into multiple final results. If the service detects pauses or
366
+ # extended silence before it reaches the end of the audio stream, its response can
367
+ # include multiple final results. Silence indicates a point at which the speaker
368
+ # pauses between spoken words or phrases.
369
+ #
370
+ # Specify a value for the pause interval in the range of 0.0 to 120.0.
371
+ # * A value greater than 0 specifies the interval that the service is to use for
372
+ # speech recognition.
373
+ # * A value of 0 indicates that the service is to use the default interval. It is
374
+ # equivalent to omitting the parameter.
375
+ #
376
+ # The default pause interval for most languages is 0.8 seconds; the default for
377
+ # Chinese is 0.6 seconds.
378
+ #
379
+ # See [End of phrase silence
380
+ # time](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-output#silence_time).
381
+ # @param split_transcript_at_phrase_end [Boolean] If `true`, directs the service to split the transcript into multiple final results
382
+ # based on semantic features of the input, for example, at the conclusion of
383
+ # meaningful phrases such as sentences. The service bases its understanding of
384
+ # semantic features on the base language model that you use with a request. Custom
385
+ # language models and grammars can also influence how and where the service splits a
386
+ # transcript. By default, the service splits transcripts based solely on the pause
387
+ # interval.
388
+ #
389
+ # See [Split transcript at phrase
390
+ # end](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-output#split_transcript).
361
391
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
362
- def recognize(audio:, content_type: nil, model: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil, audio_metrics: nil)
392
+ def recognize(audio:, content_type: nil, model: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil, audio_metrics: nil, end_of_phrase_silence_time: nil, split_transcript_at_phrase_end: nil)
363
393
  raise ArgumentError.new("audio must be provided") if audio.nil?
364
394
 
365
395
  headers = {
@@ -388,7 +418,9 @@ module IBMWatson
388
418
  "customization_id" => customization_id,
389
419
  "grammar_name" => grammar_name,
390
420
  "redaction" => redaction,
391
- "audio_metrics" => audio_metrics
421
+ "audio_metrics" => audio_metrics,
422
+ "end_of_phrase_silence_time" => end_of_phrase_silence_time,
423
+ "split_transcript_at_phrase_end" => split_transcript_at_phrase_end
392
424
  }
393
425
 
394
426
  data = audio
@@ -407,7 +439,7 @@ module IBMWatson
407
439
  end
408
440
 
409
441
  ##
410
- # @!method recognize_using_websocket(content_type: nil,recognize_callback:,audio: nil,chunk_data: false,model: nil,customization_id: nil,acoustic_customization_id: nil,customization_weight: nil,base_model_version: nil,inactivity_timeout: nil,interim_results: nil,keywords: nil,keywords_threshold: nil,max_alternatives: nil,word_alternatives_threshold: nil,word_confidence: nil,timestamps: nil,profanity_filter: nil,smart_formatting: nil,speaker_labels: nil)
442
+ # @!method recognize_using_websocket(content_type: nil,recognize_callback:,audio: nil,chunk_data: false,model: nil,customization_id: nil,acoustic_customization_id: nil,customization_weight: nil,base_model_version: nil,inactivity_timeout: nil,interim_results: nil,keywords: nil,keywords_threshold: nil,max_alternatives: nil,word_alternatives_threshold: nil,word_confidence: nil,timestamps: nil,profanity_filter: nil,smart_formatting: nil,speaker_labels: nil, end_of_phrase_silence_time: nil, split_transcript_at_phrase_end: nil)
411
443
  # Sends audio for speech recognition using web sockets.
412
444
  # @param content_type [String] The type of the input: audio/basic, audio/flac, audio/l16, audio/mp3, audio/mpeg, audio/mulaw, audio/ogg, audio/ogg;codecs=opus, audio/ogg;codecs=vorbis, audio/wav, audio/webm, audio/webm;codecs=opus, audio/webm;codecs=vorbis, or multipart/form-data.
413
445
  # @param recognize_callback [RecognizeCallback] The instance handling events returned from the service.
@@ -469,6 +501,36 @@ module IBMWatson
469
501
  # input audio. The service returns audio metrics with the final transcription
470
502
  # results. By default, the service returns no audio metrics.
471
503
  # @return [WebSocketClient] Returns a new WebSocketClient object
504
+ #
505
+ # See [Audio
506
+ # metrics](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-metrics#audio_metrics).
507
+ # @param end_of_phrase_silence_time [Float] If `true`, specifies the duration of the pause interval at which the service
508
+ # splits a transcript into multiple final results. If the service detects pauses or
509
+ # extended silence before it reaches the end of the audio stream, its response can
510
+ # include multiple final results. Silence indicates a point at which the speaker
511
+ # pauses between spoken words or phrases.
512
+ #
513
+ # Specify a value for the pause interval in the range of 0.0 to 120.0.
514
+ # * A value greater than 0 specifies the interval that the service is to use for
515
+ # speech recognition.
516
+ # * A value of 0 indicates that the service is to use the default interval. It is
517
+ # equivalent to omitting the parameter.
518
+ #
519
+ # The default pause interval for most languages is 0.8 seconds; the default for
520
+ # Chinese is 0.6 seconds.
521
+ #
522
+ # See [End of phrase silence
523
+ # time](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-output#silence_time).
524
+ # @param split_transcript_at_phrase_end [Boolean] If `true`, directs the service to split the transcript into multiple final results
525
+ # based on semantic features of the input, for example, at the conclusion of
526
+ # meaningful phrases such as sentences. The service bases its understanding of
527
+ # semantic features on the base language model that you use with a request. Custom
528
+ # language models and grammars can also influence how and where the service splits a
529
+ # transcript. By default, the service splits transcripts based solely on the pause
530
+ # interval.
531
+ #
532
+ # See [Split transcript at phrase
533
+ # end](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-output#split_transcript).
472
534
  def recognize_using_websocket(
473
535
  content_type: nil,
474
536
  recognize_callback:,
@@ -495,7 +557,9 @@ module IBMWatson
495
557
  redaction: nil,
496
558
  processing_metrics: nil,
497
559
  processing_metrics_interval: nil,
498
- audio_metrics: nil
560
+ audio_metrics: nil,
561
+ end_of_phrase_silence_time: nil,
562
+ split_transcript_at_phrase_end: nil
499
563
  )
500
564
  raise ArgumentError("Audio must be provided") if audio.nil? && !chunk_data
501
565
  raise ArgumentError("Recognize callback must be provided") if recognize_callback.nil?
@@ -532,7 +596,9 @@ module IBMWatson
532
596
  "redaction" => redaction,
533
597
  "processing_metrics" => processing_metrics,
534
598
  "processing_metrics_interval" => processing_metrics_interval,
535
- "audio_metrics" => audio_metrics
599
+ "audio_metrics" => audio_metrics,
600
+ "end_of_phrase_silence_time" => end_of_phrase_silence_time,
601
+ "split_transcript_at_phrase_end" => split_transcript_at_phrase_end
536
602
  }
537
603
  options.delete_if { |_, v| v.nil? }
538
604
  WebSocketClient.new(audio: audio, chunk_data: chunk_data, options: options, recognize_callback: recognize_callback, service_url: service_url, headers: headers, disable_ssl_verification: @disable_ssl_verification)
@@ -650,7 +716,7 @@ module IBMWatson
650
716
  end
651
717
 
652
718
  ##
653
- # @!method create_job(audio:, content_type: nil, model: nil, callback_url: nil, events: nil, user_token: nil, results_ttl: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil, processing_metrics: nil, processing_metrics_interval: nil, audio_metrics: nil)
719
+ # @!method create_job(audio:, content_type: nil, model: nil, callback_url: nil, events: nil, user_token: nil, results_ttl: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil, processing_metrics: nil, processing_metrics_interval: nil, audio_metrics: nil, end_of_phrase_silence_time: nil, split_transcript_at_phrase_end: nil)
654
720
  # Create a job.
655
721
  # Creates a job for a new asynchronous recognition request. The job is owned by the
656
722
  # instance of the service whose credentials are used to create it. How you learn the
@@ -919,6 +985,9 @@ module IBMWatson
919
985
  # the `processing_metrics_interval` parameter. It also returns processing metrics
920
986
  # for transcription events, for example, for final and interim results. By default,
921
987
  # the service returns no processing metrics.
988
+ #
989
+ # See [Processing
990
+ # metrics](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-metrics#processing_metrics).
922
991
  # @param processing_metrics_interval [Float] Specifies the interval in real wall-clock seconds at which the service is to
923
992
  # return processing metrics. The parameter is ignored unless the
924
993
  # `processing_metrics` parameter is set to `true`.
@@ -930,11 +999,44 @@ module IBMWatson
930
999
  # metrics only for transcription events instead of at periodic intervals, set the
931
1000
  # value to a large number. If the value is larger than the duration of the audio,
932
1001
  # the service returns processing metrics only for transcription events.
1002
+ #
1003
+ # See [Processing
1004
+ # metrics](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-metrics#processing_metrics).
933
1005
  # @param audio_metrics [Boolean] If `true`, requests detailed information about the signal characteristics of the
934
1006
  # input audio. The service returns audio metrics with the final transcription
935
1007
  # results. By default, the service returns no audio metrics.
1008
+ #
1009
+ # See [Audio
1010
+ # metrics](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-metrics#audio_metrics).
1011
+ # @param end_of_phrase_silence_time [Float] If `true`, specifies the duration of the pause interval at which the service
1012
+ # splits a transcript into multiple final results. If the service detects pauses or
1013
+ # extended silence before it reaches the end of the audio stream, its response can
1014
+ # include multiple final results. Silence indicates a point at which the speaker
1015
+ # pauses between spoken words or phrases.
1016
+ #
1017
+ # Specify a value for the pause interval in the range of 0.0 to 120.0.
1018
+ # * A value greater than 0 specifies the interval that the service is to use for
1019
+ # speech recognition.
1020
+ # * A value of 0 indicates that the service is to use the default interval. It is
1021
+ # equivalent to omitting the parameter.
1022
+ #
1023
+ # The default pause interval for most languages is 0.8 seconds; the default for
1024
+ # Chinese is 0.6 seconds.
1025
+ #
1026
+ # See [End of phrase silence
1027
+ # time](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-output#silence_time).
1028
+ # @param split_transcript_at_phrase_end [Boolean] If `true`, directs the service to split the transcript into multiple final results
1029
+ # based on semantic features of the input, for example, at the conclusion of
1030
+ # meaningful phrases such as sentences. The service bases its understanding of
1031
+ # semantic features on the base language model that you use with a request. Custom
1032
+ # language models and grammars can also influence how and where the service splits a
1033
+ # transcript. By default, the service splits transcripts based solely on the pause
1034
+ # interval.
1035
+ #
1036
+ # See [Split transcript at phrase
1037
+ # end](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-output#split_transcript).
936
1038
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
937
- def create_job(audio:, content_type: nil, model: nil, callback_url: nil, events: nil, user_token: nil, results_ttl: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil, processing_metrics: nil, processing_metrics_interval: nil, audio_metrics: nil)
1039
+ def create_job(audio:, content_type: nil, model: nil, callback_url: nil, events: nil, user_token: nil, results_ttl: nil, language_customization_id: nil, acoustic_customization_id: nil, base_model_version: nil, customization_weight: nil, inactivity_timeout: nil, keywords: nil, keywords_threshold: nil, max_alternatives: nil, word_alternatives_threshold: nil, word_confidence: nil, timestamps: nil, profanity_filter: nil, smart_formatting: nil, speaker_labels: nil, customization_id: nil, grammar_name: nil, redaction: nil, processing_metrics: nil, processing_metrics_interval: nil, audio_metrics: nil, end_of_phrase_silence_time: nil, split_transcript_at_phrase_end: nil)
938
1040
  raise ArgumentError.new("audio must be provided") if audio.nil?
939
1041
 
940
1042
  headers = {
@@ -969,7 +1071,9 @@ module IBMWatson
969
1071
  "redaction" => redaction,
970
1072
  "processing_metrics" => processing_metrics,
971
1073
  "processing_metrics_interval" => processing_metrics_interval,
972
- "audio_metrics" => audio_metrics
1074
+ "audio_metrics" => audio_metrics,
1075
+ "end_of_phrase_silence_time" => end_of_phrase_silence_time,
1076
+ "split_transcript_at_phrase_end" => split_transcript_at_phrase_end
973
1077
  }
974
1078
 
975
1079
  data = audio
@@ -1104,9 +1208,9 @@ module IBMWatson
1104
1208
  # model is owned by the instance of the service whose credentials are used to create
1105
1209
  # it.
1106
1210
  #
1107
- # You can create a maximum of 1024 custom language models, per credential. The
1108
- # service returns an error if you attempt to create more than 1024 models. You do
1109
- # not lose any models, but you cannot create any more until your model count is
1211
+ # You can create a maximum of 1024 custom language models per owning credentials.
1212
+ # The service returns an error if you attempt to create more than 1024 models. You
1213
+ # do not lose any models, but you cannot create any more until your model count is
1110
1214
  # below the limit.
1111
1215
  #
1112
1216
  # **See also:** [Create a custom language
@@ -2230,9 +2334,9 @@ module IBMWatson
2230
2334
  # model is owned by the instance of the service whose credentials are used to create
2231
2335
  # it.
2232
2336
  #
2233
- # You can create a maximum of 1024 custom acoustic models, per credential. The
2234
- # service returns an error if you attempt to create more than 1024 models. You do
2235
- # not lose any models, but you cannot create any more until your model count is
2337
+ # You can create a maximum of 1024 custom acoustic models per owning credentials.
2338
+ # The service returns an error if you attempt to create more than 1024 models. You
2339
+ # do not lose any models, but you cannot create any more until your model count is
2236
2340
  # below the limit.
2237
2341
  #
2238
2342
  # **See also:** [Create a custom acoustic
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -263,7 +263,8 @@ module IBMWatson
263
263
  # specific voice to see the default translation for the language of that voice or
264
264
  # for a specific custom voice model to see the translation for that voice model.
265
265
  #
266
- # **Note:** This method is currently a beta release.
266
+ # **Note:** This method is currently a beta release. The method does not support the
267
+ # Arabic, Chinese, and Dutch languages.
267
268
  #
268
269
  # **See also:** [Querying a word from a
269
270
  # language](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuWordsQueryLanguage).
@@ -319,7 +320,8 @@ module IBMWatson
319
320
  # model. The model is owned by the instance of the service whose credentials are
320
321
  # used to create it.
321
322
  #
322
- # **Note:** This method is currently a beta release.
323
+ # **Note:** This method is currently a beta release. The service does not support
324
+ # voice model customization for the Arabic, Chinese, and Dutch languages.
323
325
  #
324
326
  # **See also:** [Creating a custom
325
327
  # model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customModels#cuModelsCreate).
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IBMWatson
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -177,7 +177,8 @@ module IBMWatson
177
177
  #
178
178
  # Specify the parameter name by appending `_positive_examples` to the class name.
179
179
  # For example, `goldenretriever_positive_examples` creates the class
180
- # **goldenretriever**.
180
+ # **goldenretriever**. The string cannot contain the following characters: ``$ * - {
181
+ # } \ | / ' " ` [ ]``.
181
182
  #
182
183
  # Include at least 10 images in .jpg or .png format. The minimum recommended image
183
184
  # resolution is 32X32 pixels. The maximum number of images is 10,000 images or 100
@@ -328,7 +329,8 @@ module IBMWatson
328
329
  #
329
330
  # Specify the parameter name by appending `_positive_examples` to the class name.
330
331
  # For example, `goldenretriever_positive_examples` creates the class
331
- # `goldenretriever`.
332
+ # `goldenretriever`. The string cannot contain the following characters: ``$ * - { }
333
+ # \ | / ' " ` [ ]``.
332
334
  #
333
335
  # Include at least 10 images in .jpg or .png format. The minimum recommended image
334
336
  # resolution is 32X32 pixels. The maximum number of images is 10,000 images or 100
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) Copyright IBM Corp. 2019.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -88,7 +88,7 @@ if !ENV["SPEECH_TO_TEXT_APIKEY"].nil? && !ENV["SPEECH_TO_TEXT_URL"].nil?
88
88
  end
89
89
 
90
90
  def test_recognize_with_single_keyword
91
- file = File.open(Dir.getwd + "/resources/speech.wav")
91
+ file = File.open(Dir.getwd + "/resources/sound-with-pause.wav")
92
92
  output = nil
93
93
  File.open(file) do |audio_file|
94
94
  output = @service.recognize(
@@ -97,9 +97,12 @@ if !ENV["SPEECH_TO_TEXT_APIKEY"].nil? && !ENV["SPEECH_TO_TEXT_URL"].nil?
97
97
  timestamps: true,
98
98
  word_alternatives_threshold: 0.9,
99
99
  keywords: %w"[colorado]",
100
- keywords_threshold: 0.5
100
+ keywords_threshold: 0.5,
101
+ split_transcript_at_phrase_end: true,
102
+ end_of_phrase_silence_time: nil
101
103
  )
102
104
  refute_nil(output.result["results"][0]["alternatives"][0]["transcript"])
105
+ assert(3, output.result["results"].length)
103
106
  end
104
107
  end
105
108
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_watson
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Nussbaum
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-27 00:00:00.000000000 Z
11
+ date: 2020-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -347,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
347
  - !ruby/object:Gem::Version
348
348
  version: '0'
349
349
  requirements: []
350
- rubygems_version: 3.0.6
350
+ rubygems_version: 3.1.2
351
351
  signing_key:
352
352
  specification_version: 4
353
353
  summary: Official client library to use the IBM Watson Services