Skip to content

Commit e999455

Browse files
NeonDanielJarbasAl
andauthored
0.1.0 (#29)
# Changelog ## [0.0.5a8](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/tree/0.0.5a8) (2025-03-14) [Full Changelog](0.0.5a7...0.0.5a8) **Merged pull requests:** - Pin ovos-stt-http-server dependency to resolve Gradio deployment bug [\#28](#28) ([NeonDaniel](https://github.com/NeonDaniel)) ## [0.0.5a7](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/tree/0.0.5a7) (2025-03-14) [Full Changelog](0.0.5a6...0.0.5a7) **Merged pull requests:** - Update dependencies [\#27](#27) ([NeonDaniel](https://github.com/NeonDaniel)) ## [0.0.5a6](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/tree/0.0.5a6) (2025-03-14) [Full Changelog](0.0.4...0.0.5a6) **Merged pull requests:** - Update GitHub Actions and License Notices [\#26](#26) ([NeonDaniel](https://github.com/NeonDaniel)) - Add support for multiple transcripts with updated unit tests [\#25](#25) ([NeonDaniel](https://github.com/NeonDaniel)) - Update OPM dependency to allow latest stable version [\#24](#24) ([NeonDaniel](https://github.com/NeonDaniel)) - feat/accept model from path [\#23](#23) ([JarbasAl](https://github.com/JarbasAl)) - Update dependencies to allow ovos-utils 0.1 [\#22](#22) ([NeonDaniel](https://github.com/NeonDaniel)) - Add test case to validate available languages [\#21](#21) ([NeonDaniel](https://github.com/NeonDaniel)) \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* --------- Co-authored-by: Daniel McKnight <[email protected]> Co-authored-by: Daniel McKnight <[email protected]> Co-authored-by: NeonDaniel <[email protected]> Co-authored-by: JarbasAI <[email protected]>
2 parents 07ada85 + 2f39221 commit e999455

File tree

10 files changed

+86
-43
lines changed

10 files changed

+86
-43
lines changed

.github/workflows/publish_test_build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
with:
1616
version_file: "version.py"
1717
setup_py: "setup.py"
18+
publish_prerelease: true
19+
update_changelog: true
1820
build_and_publish_docker:
1921
needs: publish_alpha_release
2022
uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master

.github/workflows/unit_tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
unit_tests:
1414
strategy:
1515
matrix:
16-
python-version: [ 3.7, 3.8, 3.9 ]
16+
python-version: [ 3.9, "3.10", "3.11" ]
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
- name: Set up python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install dependencies
@@ -35,8 +35,8 @@ jobs:
3535
run: |
3636
pytest tests/test_stt.py --junitxml=tests/stt-test-results.xml
3737
- name: Upload STT test results
38-
uses: actions/upload-artifact@v2
38+
uses: actions/upload-artifact@v4
3939
with:
40-
name: pytest-results-3.7
40+
name: pytest-results-${{ matrix.python-version }}
4141
path: tests/stt-test-results.xml
4242
if: ${{ always() }}

CHANGELOG.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
# Changelog
22

3-
## [0.0.4](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/tree/0.0.4) (2023-06-27)
3+
## [0.0.5a8](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/tree/0.0.5a8) (2025-03-14)
44

5-
[Full Changelog](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/compare/0.0.2...0.0.4)
5+
[Full Changelog](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/compare/0.0.5a7...0.0.5a8)
66

77
**Merged pull requests:**
88

9-
- Update Docker and docs [\#18](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/18) ([NeonDaniel](https://github.com/NeonDaniel))
10-
- Using ONNX Nemo STT [\#15](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/15) ([NeonBohdan](https://github.com/NeonBohdan))
11-
- Docker container and Updated GitHub Automation [\#13](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/13) ([NeonDaniel](https://github.com/NeonDaniel))
12-
- Add `available_languages` property [\#11](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/11) ([NeonDaniel](https://github.com/NeonDaniel))
9+
- Pin ovos-stt-http-server dependency to resolve Gradio deployment bug [\#28](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/28) ([NeonDaniel](https://github.com/NeonDaniel))
10+
11+
## [0.0.5a7](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/tree/0.0.5a7) (2025-03-14)
12+
13+
[Full Changelog](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/compare/0.0.5a6...0.0.5a7)
14+
15+
**Merged pull requests:**
16+
17+
- Update dependencies [\#27](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/27) ([NeonDaniel](https://github.com/NeonDaniel))
18+
19+
## [0.0.5a6](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/tree/0.0.5a6) (2025-03-14)
20+
21+
[Full Changelog](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/compare/0.0.4...0.0.5a6)
22+
23+
**Merged pull requests:**
24+
25+
- Update GitHub Actions and License Notices [\#26](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/26) ([NeonDaniel](https://github.com/NeonDaniel))
26+
- Add support for multiple transcripts with updated unit tests [\#25](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/25) ([NeonDaniel](https://github.com/NeonDaniel))
27+
- Update OPM dependency to allow latest stable version [\#24](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/24) ([NeonDaniel](https://github.com/NeonDaniel))
28+
- feat/accept model from path [\#23](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/23) ([JarbasAl](https://github.com/JarbasAl))
29+
- Update dependencies to allow ovos-utils 0.1 [\#22](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/22) ([NeonDaniel](https://github.com/NeonDaniel))
30+
- Add test case to validate available languages [\#21](https://github.com/NeonGeckoCom/neon-stt-plugin-nemo/pull/21) ([NeonDaniel](https://github.com/NeonDaniel))
1331

1432

1533

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
22
# All trademark and other rights reserved by their respective owners
3-
# Copyright 2008-2021 Neongecko.com Inc.
3+
# Copyright 2008-2025 Neongecko.com Inc.
44
# BSD-3 License
55

66
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the

neon_stt_plugin_nemo/__init__.py

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework
22
# All trademark and other rights reserved by their respective owners
3-
# Copyright 2008-2022 Neongecko.com Inc.
3+
# Copyright 2008-2025 Neongecko.com Inc.
44
# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds,
55
# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo
66
# BSD-3 License
@@ -25,6 +25,7 @@
2525
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2626
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2727
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
from typing import Optional, List, Tuple
2829

2930
import numpy as np
3031

@@ -45,35 +46,49 @@ def __init__(self, config: dict = None):
4546

4647
self._engines = {}
4748
self.cache_engines = self.config.get("cache", True)
49+
self.default_model = self.config.get("model", None)
4850
if self.cache_engines:
49-
self._init_model(self.lang)
51+
self._init_model()
5052

51-
def _init_model(self, language) -> Model:
53+
def _init_model(self, language=None) -> Model:
5254
# OVOS uses 'en-us' so this hacks that to work until dialects are supported
53-
language = (language or self.lang).split('-')[0]
54-
if language not in self._engines:
55-
model = Model(language)
55+
lang = (language or self.lang).split('-')[0]
56+
if lang not in self._engines:
57+
if self.default_model and language is None:
58+
model = Model(lang=lang, model_folder=self.default_model)
59+
else:
60+
model = Model(lang=lang)
5661
if self.cache_engines:
57-
self._engines[language] = model
62+
self._engines[lang] = model
5863
else:
59-
model = self._engines[language]
64+
model = self._engines[lang]
6065

6166
return model
6267

6368
@property
6469
def available_languages(self) -> set:
6570
return set(available_languages)
6671

67-
def execute(self, audio: AudioData, language = None):
68-
'''
69-
Executes speach recognition
72+
def execute(self, audio: AudioData, language: Optional[str] = None) -> str:
73+
"""
74+
Executes speech recognition and returns the most likely transcription
75+
@param audio: input audio data
76+
@param language: language of input audio
77+
@return: recognized text
78+
"""
7079

71-
Parameters:
72-
audio : input audio file path
73-
Returns:
74-
text (str): recognized text
75-
'''
76-
model = self._init_model(language)
80+
return self.transcribe(audio, language)[0][0]
81+
82+
def transcribe(self, audio,
83+
lang: Optional[str] = None) -> List[Tuple[str, float]]:
84+
"""
85+
Executes speech recognition and returns a list of possible
86+
transcriptions with associated confidence levels.
87+
@param audio: input audio data
88+
@param lang: language of input audio
89+
@return: List of (transcript, confidence) elements
90+
"""
91+
model = self._init_model(lang)
7792

7893
audio_buffer = np.frombuffer(audio.get_raw_data(), dtype=np.int16)
7994
self.transcriptions = model.stt(audio_buffer, audio.sample_rate)
@@ -83,6 +98,5 @@ def execute(self, audio: AudioData, language = None):
8398
self.transcriptions = []
8499
else:
85100
LOG.debug("Audio had data")
86-
# TODO: Return a string since we currently only get one result and the
87-
# ovos-stt-server only handles strings here
88-
return self.transcriptions[0]
101+
# Models do not return confidence, so just assume max of 1.0
102+
return [(t, 1.0) for t in self.transcriptions]

requirements/docker.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
ovos-stt-http-server~=0.0.2
1+
ovos-stt-http-server==0.0.2
2+
# TODO: Gradio broken in 0.0.3+ with fix in https://github.com/OpenVoiceOS/ovos-stt-http-server/pull/28

requirements/requirements.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
ovos-plugin-manager~=0.0.21
2-
ovos-utils~=0.0.30
3-
streaming-stt-nemo~=0.2
1+
ovos-plugin-manager~=0.0,>=0.0.24
2+
ovos-utils~=0.0,>=0.0.30
3+
streaming-stt-nemo~=0.3
44
SpeechRecognition~=3.8
5-
6-
# TODO: Patching OPM
7-
mycroft-messagebus-client~=0.10

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
22
#
3-
# Copyright 2008-2021 Neongecko.com Inc. | All Rights Reserved
3+
# Copyright 2008-2025 Neongecko.com Inc. | All Rights Reserved
44
#
55
# Notice of License - Duplicating this Notice of License near the start of any file containing
66
# a derivative of this software is a condition of license for this software.

tests/test_stt.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework
22
# All trademark and other rights reserved by their respective owners
3-
# Copyright 2008-2022 Neongecko.com Inc.
3+
# Copyright 2008-2025 Neongecko.com Inc.
44
# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds,
55
# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo
66
# BSD-3 License
@@ -51,6 +51,17 @@ def test_get_stt(self):
5151
audio = r.record(source) # read the entire audio file
5252
result = self.stt.execute(audio)
5353
self.assertIn(transcription, result)
54+
results = self.stt.transcribe(audio)
55+
self.assertEqual(results[0][0], result)
56+
for result in results:
57+
self.assertIsInstance(result[0], str)
58+
self.assertIsInstance(result[1], float)
59+
60+
def test_available_languages(self):
61+
langs = self.stt.available_languages
62+
self.assertIsInstance(langs, set)
63+
self.assertTrue(all((isinstance(lang, str) for lang in langs)))
64+
self.assertIn("en", langs)
5465

5566

5667
if __name__ == '__main__':

version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
22
#
3-
# Copyright 2008-2021 Neongecko.com Inc. | All Rights Reserved
3+
# Copyright 2008-2025 Neongecko.com Inc. | All Rights Reserved
44
#
55
# Notice of License - Duplicating this Notice of License near the start of any file containing
66
# a derivative of this software is a condition of license for this software.
@@ -17,4 +17,4 @@
1717
# US Patents 2008-2021: US7424516, US20140161250, US20140177813, US8638908, US8068604, US8553852, US10530923, US10530924
1818
# China Patent: CN102017585 - Europe Patent: EU2156652 - Patents Pending
1919

20-
__version__ = "0.0.4"
20+
__version__ = "0.1.0"

0 commit comments

Comments
 (0)