ibm_watson 0.9.1 → 0.9.2
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/lib/ibm_watson/speech_to_text_v1.rb +2 -1
- data/lib/ibm_watson/version.rb +1 -1
- data/test/integration/test_speech_to_text_v1.rb +31 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2339230f5cc6e45ede3db381b47265019e10fee0cb9147b0a5fc6e6f4bb216ff
         | 
| 4 | 
            +
              data.tar.gz: 313d1675f687555eca475a7ad1e072b44c40fcee95f4c3efa0286ca9c027e4f9
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 7826f822275d6e8f0806ad3f78a00801482d33bd2dff674f9e29512abdd4104fc6cc567fd3fd909b40a089819e96bdae987036685655267e07e53d9db69c6a14
         | 
| 7 | 
            +
              data.tar.gz: 3017550a16f71a9a772b1f07a70643ddfbc72077ef37c7abea729bdf48b6088b552ffcc6b80be81fb8e569706a82b0812b66f70ab0b1074316947610c6bed301
         | 
| @@ -328,6 +328,7 @@ module IBMWatson | |
| 328 328 | 
             
                  headers = {
         | 
| 329 329 | 
             
                    "Content-Type" => content_type
         | 
| 330 330 | 
             
                  }
         | 
| 331 | 
            +
                  keywords *= "," unless keywords.nil?
         | 
| 331 332 | 
             
                  params = {
         | 
| 332 333 | 
             
                    "model" => model,
         | 
| 333 334 | 
             
                    "language_customization_id" => language_customization_id,
         | 
| @@ -335,7 +336,7 @@ module IBMWatson | |
| 335 336 | 
             
                    "base_model_version" => base_model_version,
         | 
| 336 337 | 
             
                    "customization_weight" => customization_weight,
         | 
| 337 338 | 
             
                    "inactivity_timeout" => inactivity_timeout,
         | 
| 338 | 
            -
                    "keywords" => keywords | 
| 339 | 
            +
                    "keywords" => keywords,
         | 
| 339 340 | 
             
                    "keywords_threshold" => keywords_threshold,
         | 
| 340 341 | 
             
                    "max_alternatives" => max_alternatives,
         | 
| 341 342 | 
             
                    "word_alternatives_threshold" => word_alternatives_threshold,
         | 
    
        data/lib/ibm_watson/version.rb
    CHANGED
    
    
| @@ -69,6 +69,37 @@ if !ENV["SPEECH_TO_TEXT_USERNAME"].nil? && !ENV["SPEECH_TO_TEXT_PASSWORD"].nil? | |
| 69 69 | 
             
                  refute_nil(output["results"][0]["alternatives"][0]["transcript"])
         | 
| 70 70 | 
             
                end
         | 
| 71 71 |  | 
| 72 | 
            +
                def test_recognize_with_keywords
         | 
| 73 | 
            +
                  file = File.open(Dir.getwd + "/resources/speech.wav")
         | 
| 74 | 
            +
                  File.open(file) do |audio_file|
         | 
| 75 | 
            +
                    output = @service.recognize(
         | 
| 76 | 
            +
                      audio: audio_file,
         | 
| 77 | 
            +
                      content_type: "audio/l16; rate=44100",
         | 
| 78 | 
            +
                      timestamps: true,
         | 
| 79 | 
            +
                      word_alternatives_threshold: 0.9,
         | 
| 80 | 
            +
                      keywords: %w"[colorado tornado]",
         | 
| 81 | 
            +
                      keywords_threshold: 0.5
         | 
| 82 | 
            +
                    )
         | 
| 83 | 
            +
                    refute_nil(output.result["results"][0]["alternatives"][0]["transcript"])
         | 
| 84 | 
            +
                  end
         | 
| 85 | 
            +
                end
         | 
| 86 | 
            +
             | 
| 87 | 
            +
                def test_recognize_with_single_keyword
         | 
| 88 | 
            +
                  file = File.open(Dir.getwd + "/resources/speech.wav")
         | 
| 89 | 
            +
                  output = nil
         | 
| 90 | 
            +
                  File.open(file) do |audio_file|
         | 
| 91 | 
            +
                    output = @service.recognize(
         | 
| 92 | 
            +
                      audio: audio_file,
         | 
| 93 | 
            +
                      content_type: "audio/l16; rate=44100",
         | 
| 94 | 
            +
                      timestamps: true,
         | 
| 95 | 
            +
                      word_alternatives_threshold: 0.9,
         | 
| 96 | 
            +
                      keywords: %w"[colorado]",
         | 
| 97 | 
            +
                      keywords_threshold: 0.5
         | 
| 98 | 
            +
                    )
         | 
| 99 | 
            +
                    refute_nil(output.result["results"][0]["alternatives"][0]["transcript"])
         | 
| 100 | 
            +
                  end
         | 
| 101 | 
            +
                end
         | 
| 102 | 
            +
             | 
| 72 103 | 
             
                def test_recognize_async
         | 
| 73 104 | 
             
                  audio_file = File.open(Dir.getwd + "/resources/speech.wav")
         | 
| 74 105 | 
             
                  future = @service.async.recognize(
         | 
    
        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: 0.9. | 
| 4 | 
            +
              version: 0.9.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Max Nussbaum
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018-11- | 
| 11 | 
            +
            date: 2018-11-21 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: concurrent-ruby
         |