speech_to_text 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/speech_to_text/deepspeech.rb +17 -4
- data/lib/speech_to_text/version.rb +1 -1
- 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: 5e8725789d4d0b24eef7fbd412c0b2ac2104f582353621ae8eef92abd63a6999
|
4
|
+
data.tar.gz: c88650f4efd23b66ddba596bafadc2a83c9e079a4d32f294e5876076c308b0bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 942193544f80fdd1ebfce25b5e9ff4e5e1d395c6f4128f36415bead32df2837313bacd57301423055921891761cf4e1d3fe00a9a4ab93e56b2e6232221171b3d
|
7
|
+
data.tar.gz: 666f1883aaad8b64b805681527fb3604df6cc531ecdd902dd4d12de01dda433ce3dd1dde29388bc4d404b13ed4e54a6f3ad9686d8825eb84c5c54bcc00ce273a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
speech_to_text (0.1.
|
4
|
+
speech_to_text (0.1.7)
|
5
5
|
google-cloud-speech (= 0.35.0)
|
6
6
|
google-cloud-storage (= 1.18.2)
|
7
7
|
ibm_watson (~> 0.18.2)
|
@@ -130,4 +130,4 @@ DEPENDENCIES
|
|
130
130
|
speech_to_text!
|
131
131
|
|
132
132
|
BUNDLED WITH
|
133
|
-
2.
|
133
|
+
2.1.4
|
@@ -71,8 +71,8 @@ module SpeechToText
|
|
71
71
|
|
72
72
|
# used by deepspeech server only
|
73
73
|
def self.generate_transcript(audio, json_file, model_path)
|
74
|
-
deepspeech_command = "#{model_path}/deepspeech --model #{model_path}/models/output_graph.pbmm --alphabet #{model_path}/models/alphabet.txt --lm #{model_path}/models/lm.binary --trie #{model_path}/models/trie -e --audio #{audio} > #{json_file}"
|
75
|
-
|
74
|
+
#deepspeech_command = "#{model_path}/deepspeech --model #{model_path}/models/output_graph.pbmm --alphabet #{model_path}/models/alphabet.txt --lm #{model_path}/models/lm.binary --trie #{model_path}/models/trie -e --audio #{audio} > #{json_file}"
|
75
|
+
deepspeech_command = "#{model_path}/deepspeech --json --model #{model_path}/deepspeech-0.6.1-models/output_graph.pbmm --lm #{model_path}/deepspeech-0.6.1-models/lm.binary --trie #{model_path}/deepspeech-0.6.1-models/trie --audio #{audio} > #{json_file}"
|
76
76
|
Open3.popen2e(deepspeech_command) do |stdin, stdout_err, wait_thr|
|
77
77
|
while line = stdout_err.gets
|
78
78
|
puts "#{line}"
|
@@ -85,11 +85,10 @@ module SpeechToText
|
|
85
85
|
puts '---------------------'
|
86
86
|
end
|
87
87
|
end
|
88
|
-
|
89
88
|
end
|
90
89
|
|
91
90
|
# rubocop:disable Metrics/MethodLength
|
92
|
-
def self.
|
91
|
+
def self.create_mozilla_array_old(data) # rubocop:disable Metrics/AbcSize
|
93
92
|
i = 0
|
94
93
|
myarray = []
|
95
94
|
while i < data['words'].length
|
@@ -105,6 +104,20 @@ module SpeechToText
|
|
105
104
|
end
|
106
105
|
myarray
|
107
106
|
end
|
107
|
+
|
108
|
+
|
109
|
+
def self.create_mozilla_array(data) # rubocop:disable Metrics/AbcSize
|
110
|
+
i = 0
|
111
|
+
myarray = []
|
112
|
+
while i < data['words'].length
|
113
|
+
myarray.push(data['words'][i]['start_time '].to_f)
|
114
|
+
endtime = data['words'][i]['start_time '].to_f + data['words'][i]['duration'].to_f
|
115
|
+
myarray.push(endtime)
|
116
|
+
myarray.push(data['words'][i]['word'])
|
117
|
+
i += 1
|
118
|
+
end
|
119
|
+
myarray
|
120
|
+
end
|
108
121
|
# rubocop:enable Metrics/MethodLength
|
109
122
|
end
|
110
123
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speech_to_text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Alam
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|