azure_stt 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ci.yml +33 -0
- data/.gitignore +56 -0
- data/.rubocop.yml +22 -0
- data/CHANGELOG.md +28 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +141 -0
- data/LICENSE +21 -0
- data/README.md +129 -0
- data/Rakefile +27 -0
- data/azure_stt.gemspec +29 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/docs/AzureBatchTranscription.html +301 -0
- data/docs/AzureBatchTranscription/Configuration.html +212 -0
- data/docs/AzureSTT.html +305 -0
- data/docs/AzureSTT/Client.html +1008 -0
- data/docs/AzureSTT/Configuration.html +282 -0
- data/docs/AzureSTT/Error.html +305 -0
- data/docs/AzureSTT/Models.html +135 -0
- data/docs/AzureSTT/Models/Base.html +139 -0
- data/docs/AzureSTT/Models/CombinedRecognizedPhrases.html +538 -0
- data/docs/AzureSTT/Models/File.html +794 -0
- data/docs/AzureSTT/Models/RecognizedPhrase.html +769 -0
- data/docs/AzureSTT/Models/Report.html +384 -0
- data/docs/AzureSTT/Models/Result.html +796 -0
- data/docs/AzureSTT/Models/Sentence.html +615 -0
- data/docs/AzureSTT/Models/Transcription.html +1415 -0
- data/docs/AzureSTT/Models/Word.html +615 -0
- data/docs/AzureSTT/NetError.html +159 -0
- data/docs/AzureSTT/Parsers.html +128 -0
- data/docs/AzureSTT/Parsers/Base.html +404 -0
- data/docs/AzureSTT/Parsers/CombinedRecognizedPhrases.html +156 -0
- data/docs/AzureSTT/Parsers/File.html +156 -0
- data/docs/AzureSTT/Parsers/RecognizedPhrase.html +156 -0
- data/docs/AzureSTT/Parsers/Report.html +156 -0
- data/docs/AzureSTT/Parsers/Result.html +156 -0
- data/docs/AzureSTT/Parsers/Sentence.html +156 -0
- data/docs/AzureSTT/Parsers/Transcription.html +156 -0
- data/docs/AzureSTT/Parsers/Word.html +156 -0
- data/docs/AzureSTT/ServiceError.html +159 -0
- data/docs/AzureSTT/Session.html +767 -0
- data/docs/AzureSTT/Transcription.html +635 -0
- data/docs/AzureSTT/Types.html +116 -0
- data/docs/AzureStt_.html +121 -0
- data/docs/_index.html +392 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +497 -0
- data/docs/file.README.html +201 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +201 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +707 -0
- data/docs/top-level-namespace.html +110 -0
- data/env.sample +2 -0
- data/lib/azure_stt.rb +20 -0
- data/lib/azure_stt/client.rb +189 -0
- data/lib/azure_stt/configuration.rb +28 -0
- data/lib/azure_stt/errors.rb +25 -0
- data/lib/azure_stt/models.rb +30 -0
- data/lib/azure_stt/models/base.rb +27 -0
- data/lib/azure_stt/models/combined_recognized_phrases.rb +48 -0
- data/lib/azure_stt/models/file.rb +72 -0
- data/lib/azure_stt/models/recognized_phrase.rb +70 -0
- data/lib/azure_stt/models/report.rb +31 -0
- data/lib/azure_stt/models/result.rb +76 -0
- data/lib/azure_stt/models/sentence.rb +53 -0
- data/lib/azure_stt/models/transcription.rb +185 -0
- data/lib/azure_stt/models/word.rb +54 -0
- data/lib/azure_stt/parsers.rb +19 -0
- data/lib/azure_stt/parsers/base.rb +42 -0
- data/lib/azure_stt/parsers/combined_recognized_phrases.rb +28 -0
- data/lib/azure_stt/parsers/file.rb +28 -0
- data/lib/azure_stt/parsers/recognized_phrase.rb +45 -0
- data/lib/azure_stt/parsers/report.rb +25 -0
- data/lib/azure_stt/parsers/result.rb +56 -0
- data/lib/azure_stt/parsers/sentence.rb +45 -0
- data/lib/azure_stt/parsers/transcription.rb +34 -0
- data/lib/azure_stt/parsers/word.rb +28 -0
- data/lib/azure_stt/session.rb +100 -0
- data/lib/azure_stt/version.rb +5 -0
- metadata +158 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e8cb5e486fa082beb925bfeee201186dd7d491d14c8af6ecdc94c77ed96dcc8a
|
4
|
+
data.tar.gz: 68092a79050495f38afe6ec2e02724cff5f6d317f6a31db9d8a64ba9c7483e47
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: df6bde989e552534df4b69279268ff936bceb8268e82b29494e288cb897e1f1a2a30e3199f89d7e7165e1470a547e7b003a13492271138968b422a0ef7875c1b
|
7
|
+
data.tar.gz: ad85958c4d6ac99a8d18cb28551dc6b434ae4469da7f7d07a494acbf753f2035a3b28743e1f8b16a2d72f5832190c4dd6fe44dff97641dd245e7277fe8c56f51
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ '**' ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: 2.6
|
20
|
+
- name: Install dependencies
|
21
|
+
run: bundle install
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rake ci
|
24
|
+
env:
|
25
|
+
REGION: uscentral
|
26
|
+
SUBSCRIPTION_KEY: k3ah8ztrc4ojeh98r05zh7v6x9w62lqp
|
27
|
+
- name: Coveralls
|
28
|
+
uses: coverallsapp/github-action@master
|
29
|
+
with:
|
30
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
31
|
+
path-to-lcov: "./coverage/lcov.info"
|
32
|
+
- name: Rubocop
|
33
|
+
run: rubocop
|
data/.gitignore
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
.env
|
15
|
+
|
16
|
+
# Ignore Byebug command history file.
|
17
|
+
.byebug_history
|
18
|
+
|
19
|
+
## Specific to RubyMotion:
|
20
|
+
.dat*
|
21
|
+
.repl_history
|
22
|
+
build/
|
23
|
+
*.bridgesupport
|
24
|
+
build-iPhoneOS/
|
25
|
+
build-iPhoneSimulator/
|
26
|
+
|
27
|
+
## Specific to RubyMotion (use of CocoaPods):
|
28
|
+
#
|
29
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
30
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
31
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
32
|
+
#
|
33
|
+
# vendor/Pods/
|
34
|
+
|
35
|
+
## Documentation cache and generated files:
|
36
|
+
/.yardoc/
|
37
|
+
/_yardoc/
|
38
|
+
/doc/
|
39
|
+
/rdoc/
|
40
|
+
|
41
|
+
## Environment normalization:
|
42
|
+
/.bundle/
|
43
|
+
/vendor/bundle
|
44
|
+
/lib/bundler/man/
|
45
|
+
|
46
|
+
# for a library or gem, you might want to ignore these files since the code is
|
47
|
+
# intended to run in multiple environments; otherwise, check them in:
|
48
|
+
# Gemfile.lock
|
49
|
+
# .ruby-version
|
50
|
+
# .ruby-gemset
|
51
|
+
|
52
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
53
|
+
.rvmrc
|
54
|
+
|
55
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
56
|
+
# .rubocop-https?--*
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-performance
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
DisplayCopNames: true
|
7
|
+
NewCops: enable
|
8
|
+
TargetRubyVersion: 2.6
|
9
|
+
|
10
|
+
Layout/LineLength:
|
11
|
+
Max: 100
|
12
|
+
|
13
|
+
Metrics/MethodLength:
|
14
|
+
Max: 20
|
15
|
+
|
16
|
+
Metrics/BlockLength:
|
17
|
+
Exclude:
|
18
|
+
- 'Rakefile'
|
19
|
+
- 'spec/**/*.rb'
|
20
|
+
|
21
|
+
Style/Documentation:
|
22
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog][Keep a Changelog] and this project adheres to [Semantic Versioning][Semantic Versioning].
|
5
|
+
|
6
|
+
## [Unreleased]
|
7
|
+
|
8
|
+
## [0.1.0] - 2021-06-24
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
* Start a transcription
|
13
|
+
|
14
|
+
* Retrieve a transcription and its results
|
15
|
+
|
16
|
+
---
|
17
|
+
|
18
|
+
## [Released]
|
19
|
+
|
20
|
+
---
|
21
|
+
|
22
|
+
<!-- Links -->
|
23
|
+
[Keep a Changelog]: https://keepachangelog.com/
|
24
|
+
[Semantic Versioning]: https://semver.org/
|
25
|
+
|
26
|
+
<!-- Versions -->
|
27
|
+
[Unreleased]: https://github.com/PerfectMemory/azure_stt/compare/next
|
28
|
+
[Released]: https://github.com/PerfectMemory/azure_stt/releases
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at francoispouly@hotmail.fr. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
gem 'dry-struct', '~> 1'
|
6
|
+
gem 'httparty', '~> 0.17'
|
7
|
+
|
8
|
+
group :test do
|
9
|
+
gem 'bundler', '~> 1.17'
|
10
|
+
gem 'dotenv'
|
11
|
+
gem 'factory_bot', '~> 6'
|
12
|
+
gem 'faker', '~> 2'
|
13
|
+
gem 'rake', '~> 13.0'
|
14
|
+
gem 'rspec', '~> 3'
|
15
|
+
gem 'rspec-its'
|
16
|
+
gem 'rubocop', require: false
|
17
|
+
gem 'rubocop-performance', require: false
|
18
|
+
gem 'rubocop-rake', require: false
|
19
|
+
gem 'rubocop-rspec', require: false
|
20
|
+
gem 'simplecov', require: false
|
21
|
+
gem 'simplecov-lcov', require: false
|
22
|
+
gem 'webmock'
|
23
|
+
gem 'yard'
|
24
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (6.1.3.2)
|
5
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
6
|
+
i18n (>= 1.6, < 2)
|
7
|
+
minitest (>= 5.1)
|
8
|
+
tzinfo (~> 2.0)
|
9
|
+
zeitwerk (~> 2.3)
|
10
|
+
addressable (2.7.0)
|
11
|
+
public_suffix (>= 2.0.2, < 5.0)
|
12
|
+
ast (2.4.2)
|
13
|
+
concurrent-ruby (1.1.9)
|
14
|
+
crack (0.4.5)
|
15
|
+
rexml
|
16
|
+
diff-lcs (1.4.4)
|
17
|
+
docile (1.4.0)
|
18
|
+
dotenv (2.7.6)
|
19
|
+
dry-configurable (0.12.1)
|
20
|
+
concurrent-ruby (~> 1.0)
|
21
|
+
dry-core (~> 0.5, >= 0.5.0)
|
22
|
+
dry-container (0.8.0)
|
23
|
+
concurrent-ruby (~> 1.0)
|
24
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
25
|
+
dry-core (0.6.0)
|
26
|
+
concurrent-ruby (~> 1.0)
|
27
|
+
dry-inflector (0.2.0)
|
28
|
+
dry-logic (1.2.0)
|
29
|
+
concurrent-ruby (~> 1.0)
|
30
|
+
dry-core (~> 0.5, >= 0.5)
|
31
|
+
dry-struct (1.4.0)
|
32
|
+
dry-core (~> 0.5, >= 0.5)
|
33
|
+
dry-types (~> 1.5)
|
34
|
+
ice_nine (~> 0.11)
|
35
|
+
dry-types (1.5.1)
|
36
|
+
concurrent-ruby (~> 1.0)
|
37
|
+
dry-container (~> 0.3)
|
38
|
+
dry-core (~> 0.5, >= 0.5)
|
39
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
40
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
41
|
+
factory_bot (6.2.0)
|
42
|
+
activesupport (>= 5.0.0)
|
43
|
+
faker (2.18.0)
|
44
|
+
i18n (>= 1.6, < 2)
|
45
|
+
hashdiff (1.0.1)
|
46
|
+
httparty (0.18.1)
|
47
|
+
mime-types (~> 3.0)
|
48
|
+
multi_xml (>= 0.5.2)
|
49
|
+
i18n (1.8.10)
|
50
|
+
concurrent-ruby (~> 1.0)
|
51
|
+
ice_nine (0.11.2)
|
52
|
+
mime-types (3.3.1)
|
53
|
+
mime-types-data (~> 3.2015)
|
54
|
+
mime-types-data (3.2021.0225)
|
55
|
+
minitest (5.14.4)
|
56
|
+
multi_xml (0.6.0)
|
57
|
+
parallel (1.20.1)
|
58
|
+
parser (3.0.1.1)
|
59
|
+
ast (~> 2.4.1)
|
60
|
+
public_suffix (4.0.6)
|
61
|
+
rainbow (3.0.0)
|
62
|
+
rake (13.0.3)
|
63
|
+
regexp_parser (2.1.1)
|
64
|
+
rexml (3.2.5)
|
65
|
+
rspec (3.10.0)
|
66
|
+
rspec-core (~> 3.10.0)
|
67
|
+
rspec-expectations (~> 3.10.0)
|
68
|
+
rspec-mocks (~> 3.10.0)
|
69
|
+
rspec-core (3.10.1)
|
70
|
+
rspec-support (~> 3.10.0)
|
71
|
+
rspec-expectations (3.10.1)
|
72
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
+
rspec-support (~> 3.10.0)
|
74
|
+
rspec-its (1.3.0)
|
75
|
+
rspec-core (>= 3.0.0)
|
76
|
+
rspec-expectations (>= 3.0.0)
|
77
|
+
rspec-mocks (3.10.2)
|
78
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
79
|
+
rspec-support (~> 3.10.0)
|
80
|
+
rspec-support (3.10.2)
|
81
|
+
rubocop (1.17.0)
|
82
|
+
parallel (~> 1.10)
|
83
|
+
parser (>= 3.0.0.0)
|
84
|
+
rainbow (>= 2.2.2, < 4.0)
|
85
|
+
regexp_parser (>= 1.8, < 3.0)
|
86
|
+
rexml
|
87
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
88
|
+
ruby-progressbar (~> 1.7)
|
89
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
90
|
+
rubocop-ast (1.7.0)
|
91
|
+
parser (>= 3.0.1.1)
|
92
|
+
rubocop-performance (1.11.3)
|
93
|
+
rubocop (>= 1.7.0, < 2.0)
|
94
|
+
rubocop-ast (>= 0.4.0)
|
95
|
+
rubocop-rake (0.5.1)
|
96
|
+
rubocop
|
97
|
+
rubocop-rspec (2.4.0)
|
98
|
+
rubocop (~> 1.0)
|
99
|
+
rubocop-ast (>= 1.1.0)
|
100
|
+
ruby-progressbar (1.11.0)
|
101
|
+
simplecov (0.21.2)
|
102
|
+
docile (~> 1.1)
|
103
|
+
simplecov-html (~> 0.11)
|
104
|
+
simplecov_json_formatter (~> 0.1)
|
105
|
+
simplecov-html (0.12.3)
|
106
|
+
simplecov-lcov (0.8.0)
|
107
|
+
simplecov_json_formatter (0.1.3)
|
108
|
+
tzinfo (2.0.4)
|
109
|
+
concurrent-ruby (~> 1.0)
|
110
|
+
unicode-display_width (2.0.0)
|
111
|
+
webmock (3.13.0)
|
112
|
+
addressable (>= 2.3.6)
|
113
|
+
crack (>= 0.3.2)
|
114
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
115
|
+
yard (0.9.26)
|
116
|
+
zeitwerk (2.4.2)
|
117
|
+
|
118
|
+
PLATFORMS
|
119
|
+
ruby
|
120
|
+
|
121
|
+
DEPENDENCIES
|
122
|
+
bundler (~> 1.17)
|
123
|
+
dotenv
|
124
|
+
dry-struct (~> 1)
|
125
|
+
factory_bot (~> 6)
|
126
|
+
faker (~> 2)
|
127
|
+
httparty (~> 0.17)
|
128
|
+
rake (~> 13.0)
|
129
|
+
rspec (~> 3)
|
130
|
+
rspec-its
|
131
|
+
rubocop
|
132
|
+
rubocop-performance
|
133
|
+
rubocop-rake
|
134
|
+
rubocop-rspec
|
135
|
+
simplecov
|
136
|
+
simplecov-lcov
|
137
|
+
webmock
|
138
|
+
yard
|
139
|
+
|
140
|
+
BUNDLED WITH
|
141
|
+
1.17.3
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 Perfect Memory
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
# azure_stt
|
2
|
+
|
3
|
+
[![CI](https://github.com/PerfectMemory/azure_stt/actions/workflows/ci.yml/badge.svg)](https://github.com/PerfectMemory/azure_stt/actions/workflows/ci.yml)
|
4
|
+
|
5
|
+
API Wrapper for the [Microsoft Azure Speech Services Speech-to-text REST API 3.0](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/rest-speech-to-text) (Cognitive Services).
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'azure_stt'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
bundle
|
19
|
+
```
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
gem install azure_stt
|
25
|
+
```
|
26
|
+
|
27
|
+
## Azure Speech-to-text Subscription key
|
28
|
+
|
29
|
+
To be able to use the gem, you must have a subscription key.
|
30
|
+
You can generate one on your Azure account.
|
31
|
+
|
32
|
+
* If you don't have an Azure account, you can create one for free on [this page](https://azure.microsoft.com/en-us/free/).
|
33
|
+
* Once logged on your [Azure portal](https://portal.azure.com/), subscribe to SpeechServices in Microsoft Cognitive Service.
|
34
|
+
* You will find two subscription keys available in 'RESOURCE MANAGEMENT > Keys' ('KEY 1' and 'KEY 2').
|
35
|
+
|
36
|
+
## Usage
|
37
|
+
|
38
|
+
### Configuration
|
39
|
+
|
40
|
+
Two environment variables are used:
|
41
|
+
|
42
|
+
- 'REGION': the region of your subscription
|
43
|
+
|
44
|
+
- 'SUBSCRIPTION_KEY': the API key you can generate on your Azure account.
|
45
|
+
|
46
|
+
You can look at the file `env.sample` and change the values.
|
47
|
+
If you do not want to use environment variables, you can configure the values like so:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
AzureSTT.configure do |config|
|
51
|
+
config.region = 'your_region'
|
52
|
+
config.subscription_key = 'your_key'
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
Finally, the class `AzureSTT::Session` uses by the default the values from the configuration, but you can initialize the session with custom values:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
session = AzureSTT::Session.new(region: 'your_region', subscription_key: 'your_key')
|
60
|
+
```
|
61
|
+
|
62
|
+
### start a transcription
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
require 'azure_stt'
|
66
|
+
|
67
|
+
properties = {
|
68
|
+
"diarizationEnabled" => false,
|
69
|
+
"wordLevelTimestampsEnabled" => false,
|
70
|
+
"punctuationMode" => "DictatedAndAutomatic",
|
71
|
+
"profanityFilterMode" => "Masked"
|
72
|
+
}
|
73
|
+
|
74
|
+
content_urls = [ 'https://path.com/audio.ogg', 'https://path.com/audio1.ogg']
|
75
|
+
|
76
|
+
session = AzureSTT::Session.new
|
77
|
+
|
78
|
+
transcription = session.create_transcription(
|
79
|
+
content_urls: content_urls,
|
80
|
+
properties: properties,
|
81
|
+
locale: 'en-US',
|
82
|
+
display_name: 'The name of the transcription')
|
83
|
+
|
84
|
+
# You can the retrieve the results of your transcription with the id
|
85
|
+
puts transcription.id
|
86
|
+
# Outputs 'your_transcription_id'
|
87
|
+
|
88
|
+
```
|
89
|
+
|
90
|
+
### Get a transcription
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
require 'azure_stt'
|
94
|
+
|
95
|
+
session = AzureSTT::Session.new
|
96
|
+
|
97
|
+
transcription = session.get_transcription('your_transcription_id')
|
98
|
+
|
99
|
+
# Returns
|
100
|
+
# #<AzureSTT::Transcription id="d35a802d-70ae-4358-a35d-b5faa0c75457"
|
101
|
+
# # model="" properties={"diarizationEnabled"=>false,
|
102
|
+
# # "wordLevelTimestampsEnabled"=>false, "channels"=>[0, 1],
|
103
|
+
# # "punctuationMode"=>"DictatedAndAutomatic", "profanityFilterMode"=>"Masked",
|
104
|
+
# # "duration"=>"PT5M18S"}
|
105
|
+
# # links={"files"=>"https://uscentral.api.cognitive.microsoft.com/speechtotext/v3.0/transcriptions/d35a802d-70ae-4358-a35d-b5faa0c75457/files"}
|
106
|
+
# # last_action_date_time=#<Date: 2020-05-31 ((2459366j,0s,0n),+0s,2299161j)> created_date_time=#<Date: 2020-05-31 ((2459366j,0s,0n),+0s,2299161j)>
|
107
|
+
# # status="Succeeded" locale="en-US" display_name="Transcription name" files=[]>
|
108
|
+
|
109
|
+
if transcription.succeeded?
|
110
|
+
# You can then access to the text, for instance :
|
111
|
+
result = transcription.results.first
|
112
|
+
puts result.text
|
113
|
+
end
|
114
|
+
```
|
115
|
+
|
116
|
+
## Development
|
117
|
+
|
118
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
119
|
+
|
120
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
121
|
+
|
122
|
+
## Contributing
|
123
|
+
|
124
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/PerfectMemory/azure_stt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
125
|
+
|
126
|
+
## Code of Conduct
|
127
|
+
|
128
|
+
Everyone interacting in the AzureStt project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/PerfectMemory/azure_stt/blob/master/CODE_OF_CONDUCT.md).
|
129
|
+
|