pvleopard 1.1.5__tar.gz → 1.2.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. {pvleopard-1.1.5 → pvleopard-1.2.0}/MANIFEST.in +1 -1
  2. {pvleopard-1.1.5 → pvleopard-1.2.0}/PKG-INFO +16 -1
  3. {pvleopard-1.1.5 → pvleopard-1.2.0}/README.md +15 -0
  4. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard/_leopard.py +21 -9
  5. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard/lib/common/leopard_params.pv +0 -0
  6. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard.egg-info/PKG-INFO +16 -1
  7. pvleopard-1.2.0/pvleopard.egg-info/SOURCES.txt +13 -0
  8. {pvleopard-1.1.5 → pvleopard-1.2.0}/setup.py +2 -2
  9. pvleopard-1.1.5/pvleopard/lib/jetson/cortex-a57-aarch64/libpv_leopard.so +0 -0
  10. pvleopard-1.1.5/pvleopard/lib/linux/x86_64/libpv_leopard.so +0 -0
  11. pvleopard-1.1.5/pvleopard/lib/mac/arm64/libpv_leopard.dylib +0 -0
  12. pvleopard-1.1.5/pvleopard/lib/mac/x86_64/libpv_leopard.dylib +0 -0
  13. pvleopard-1.1.5/pvleopard/lib/raspberry-pi/cortex-a53/libpv_leopard.so +0 -0
  14. pvleopard-1.1.5/pvleopard/lib/raspberry-pi/cortex-a53-aarch64/libpv_leopard.so +0 -0
  15. pvleopard-1.1.5/pvleopard/lib/raspberry-pi/cortex-a72/libpv_leopard.so +0 -0
  16. pvleopard-1.1.5/pvleopard/lib/raspberry-pi/cortex-a72-aarch64/libpv_leopard.so +0 -0
  17. pvleopard-1.1.5/pvleopard/lib/windows/amd64/libpv_leopard.dll +0 -0
  18. pvleopard-1.1.5/pvleopard.egg-info/SOURCES.txt +0 -22
  19. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard/LICENSE +0 -0
  20. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard/__init__.py +0 -0
  21. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard/_factory.py +0 -0
  22. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard/_util.py +0 -0
  23. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard.egg-info/dependency_links.txt +0 -0
  24. {pvleopard-1.1.5 → pvleopard-1.2.0}/pvleopard.egg-info/top_level.txt +0 -0
  25. {pvleopard-1.1.5 → pvleopard-1.2.0}/setup.cfg +0 -0
@@ -3,4 +3,4 @@ include pvleopard/__init__.py
3
3
  include pvleopard/_factory.py
4
4
  include pvleopard/_leopard.py
5
5
  include pvleopard/_util.py
6
- recursive-include pvleopard/lib/ *
6
+ include pvleopard/lib/common/leopard_params.pv
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pvleopard
3
- Version: 1.1.5
3
+ Version: 1.2.0
4
4
  Summary: Leopard Speech-to-Text Engine.
5
5
  Home-page: https://github.com/Picovoice/leopard
6
6
  Author: Picovoice
@@ -70,6 +70,21 @@ Replace `${ACCESS_KEY}` with yours obtained from [Picovoice Console](https://con
70
70
  `${AUDIO_PATH}` to the path an audio file. Finally, when done be sure to explicitly release the resources using
71
71
  `handle.delete()`.
72
72
 
73
+ ## Language Model
74
+
75
+ The Leopard Python SDK comes preloaded with a default English language model (`.pv` file).
76
+ Default models for other supported languages can be found in [lib/common](../../lib/common).
77
+
78
+ Create custom language models using the [Picovoice Console](https://console.picovoice.ai/). Here you can train
79
+ language models with custom vocabulary and boost words in the existing vocabulary.
80
+
81
+ Pass in the `.pv` file via the `model_path` argument:
82
+ ```python
83
+ handle = pvleopard.create(
84
+ access_key='${ACCESS_KEY}',
85
+ model_path='${MODEL_PATH}')
86
+ ```
87
+
73
88
  ## Demos
74
89
 
75
90
  [pvleoparddemo](https://pypi.org/project/pvleoparddemo/) provides command-line utilities for processing audio using
@@ -51,6 +51,21 @@ Replace `${ACCESS_KEY}` with yours obtained from [Picovoice Console](https://con
51
51
  `${AUDIO_PATH}` to the path an audio file. Finally, when done be sure to explicitly release the resources using
52
52
  `handle.delete()`.
53
53
 
54
+ ## Language Model
55
+
56
+ The Leopard Python SDK comes preloaded with a default English language model (`.pv` file).
57
+ Default models for other supported languages can be found in [lib/common](../../lib/common).
58
+
59
+ Create custom language models using the [Picovoice Console](https://console.picovoice.ai/). Here you can train
60
+ language models with custom vocabulary and boost words in the existing vocabulary.
61
+
62
+ Pass in the `.pv` file via the `model_path` argument:
63
+ ```python
64
+ handle = pvleopard.create(
65
+ access_key='${ACCESS_KEY}',
66
+ model_path='${MODEL_PATH}')
67
+ ```
68
+
54
69
  ## Demos
55
70
 
56
71
  [pvleoparddemo](https://pypi.org/project/pvleoparddemo/) provides command-line utilities for processing audio using
@@ -189,9 +189,17 @@ class Leopard(object):
189
189
 
190
190
  self._sample_rate = library.pv_sample_rate()
191
191
 
192
- self._pv_free = library.pv_free
193
- self._pv_free.argtypes = [c_void_p]
194
- self._pv_free.restype = None
192
+ self._transcript_delete_func = library.pv_leopard_transcript_delete
193
+ self._transcript_delete_func.argtypes = [
194
+ c_char_p
195
+ ]
196
+ self._transcript_delete_func.restype = None
197
+
198
+ self._words_delete_func = library.pv_leopard_words_delete
199
+ self._words_delete_func.argtypes = [
200
+ POINTER(self.CWord)
201
+ ]
202
+ self._words_delete_func.restype = None
195
203
 
196
204
  Word = namedtuple('Word', ['word', 'start_sec', 'end_sec', 'confidence'])
197
205
 
@@ -221,6 +229,9 @@ class Leopard(object):
221
229
  if status is not self.PicovoiceStatuses.SUCCESS:
222
230
  raise self._PICOVOICE_STATUS_TO_EXCEPTION[status]()
223
231
 
232
+ transcript = c_transcript.value.decode('utf-8')
233
+ self._transcript_delete_func(c_transcript)
234
+
224
235
  words = list()
225
236
  for i in range(num_words.value):
226
237
  word = self.Word(
@@ -230,10 +241,9 @@ class Leopard(object):
230
241
  confidence=c_words[i].confidence)
231
242
  words.append(word)
232
243
 
233
- if num_words.value > 0:
234
- self._pv_free(c_words)
244
+ self._words_delete_func(c_words)
235
245
 
236
- return c_transcript.value.decode('utf-8'), words
246
+ return transcript, words
237
247
 
238
248
  def process_file(self, audio_path: str) -> Tuple[str, Sequence[Word]]:
239
249
  """
@@ -264,6 +274,9 @@ class Leopard(object):
264
274
  )
265
275
  raise self._PICOVOICE_STATUS_TO_EXCEPTION[status]()
266
276
 
277
+ transcript = c_transcript.value.decode('utf-8')
278
+ self._transcript_delete_func(c_transcript)
279
+
267
280
  words = list()
268
281
  for i in range(num_words.value):
269
282
  word = self.Word(
@@ -273,10 +286,9 @@ class Leopard(object):
273
286
  confidence=c_words[i].confidence)
274
287
  words.append(word)
275
288
 
276
- if num_words.value > 0:
277
- self._pv_free(c_words)
289
+ self._words_delete_func(c_words)
278
290
 
279
- return c_transcript.value.decode('utf-8'), words
291
+ return transcript, words
280
292
 
281
293
  def delete(self) -> None:
282
294
  """Releases resources acquired by Leopard."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pvleopard
3
- Version: 1.1.5
3
+ Version: 1.2.0
4
4
  Summary: Leopard Speech-to-Text Engine.
5
5
  Home-page: https://github.com/Picovoice/leopard
6
6
  Author: Picovoice
@@ -70,6 +70,21 @@ Replace `${ACCESS_KEY}` with yours obtained from [Picovoice Console](https://con
70
70
  `${AUDIO_PATH}` to the path an audio file. Finally, when done be sure to explicitly release the resources using
71
71
  `handle.delete()`.
72
72
 
73
+ ## Language Model
74
+
75
+ The Leopard Python SDK comes preloaded with a default English language model (`.pv` file).
76
+ Default models for other supported languages can be found in [lib/common](../../lib/common).
77
+
78
+ Create custom language models using the [Picovoice Console](https://console.picovoice.ai/). Here you can train
79
+ language models with custom vocabulary and boost words in the existing vocabulary.
80
+
81
+ Pass in the `.pv` file via the `model_path` argument:
82
+ ```python
83
+ handle = pvleopard.create(
84
+ access_key='${ACCESS_KEY}',
85
+ model_path='${MODEL_PATH}')
86
+ ```
87
+
73
88
  ## Demos
74
89
 
75
90
  [pvleoparddemo](https://pypi.org/project/pvleoparddemo/) provides command-line utilities for processing audio using
@@ -0,0 +1,13 @@
1
+ MANIFEST.in
2
+ README.md
3
+ setup.py
4
+ pvleopard/LICENSE
5
+ pvleopard/__init__.py
6
+ pvleopard/_factory.py
7
+ pvleopard/_leopard.py
8
+ pvleopard/_util.py
9
+ pvleopard.egg-info/PKG-INFO
10
+ pvleopard.egg-info/SOURCES.txt
11
+ pvleopard.egg-info/dependency_links.txt
12
+ pvleopard.egg-info/top_level.txt
13
+ pvleopard/lib/common/leopard_params.pv
@@ -40,7 +40,7 @@ include pvleopard/__init__.py
40
40
  include pvleopard/_factory.py
41
41
  include pvleopard/_leopard.py
42
42
  include pvleopard/_util.py
43
- recursive-include pvleopard/lib/ *
43
+ include pvleopard/lib/common/leopard_params.pv
44
44
  """
45
45
 
46
46
  with open(os.path.join(os.path.dirname(__file__), 'MANIFEST.in'), 'w') as f:
@@ -51,7 +51,7 @@ with open(os.path.join(os.path.dirname(__file__), 'README.md'), 'r') as f:
51
51
 
52
52
  setuptools.setup(
53
53
  name="pvleopard",
54
- version="1.1.5",
54
+ version="1.2.0",
55
55
  author="Picovoice",
56
56
  author_email="hello@picovoice.ai",
57
57
  description="Leopard Speech-to-Text Engine.",
@@ -1,22 +0,0 @@
1
- MANIFEST.in
2
- README.md
3
- setup.py
4
- pvleopard/LICENSE
5
- pvleopard/__init__.py
6
- pvleopard/_factory.py
7
- pvleopard/_leopard.py
8
- pvleopard/_util.py
9
- pvleopard.egg-info/PKG-INFO
10
- pvleopard.egg-info/SOURCES.txt
11
- pvleopard.egg-info/dependency_links.txt
12
- pvleopard.egg-info/top_level.txt
13
- pvleopard/lib/common/leopard_params.pv
14
- pvleopard/lib/jetson/cortex-a57-aarch64/libpv_leopard.so
15
- pvleopard/lib/linux/x86_64/libpv_leopard.so
16
- pvleopard/lib/mac/arm64/libpv_leopard.dylib
17
- pvleopard/lib/mac/x86_64/libpv_leopard.dylib
18
- pvleopard/lib/raspberry-pi/cortex-a53/libpv_leopard.so
19
- pvleopard/lib/raspberry-pi/cortex-a53-aarch64/libpv_leopard.so
20
- pvleopard/lib/raspberry-pi/cortex-a72/libpv_leopard.so
21
- pvleopard/lib/raspberry-pi/cortex-a72-aarch64/libpv_leopard.so
22
- pvleopard/lib/windows/amd64/libpv_leopard.dll
File without changes
File without changes
File without changes