Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wit.ai STT Plugin update #394

Merged
merged 5 commits into from
Feb 19, 2024

Conversation

TuxSeb
Copy link
Member

@TuxSeb TuxSeb commented Feb 11, 2024

Description

Update of the Wit.AI STT plugin with latest API version (2023-02-15), updated plugin description with website

Motivation and Context

Deprecated API version (2017-03-07) and outdated plugin information (version and website url)

How Has This Been Tested?

Test by launching Naomi

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Code Update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@TuxSeb TuxSeb self-assigned this Feb 11, 2024
@CLAassistant
Copy link

CLAassistant commented Feb 11, 2024

CLA assistant check
All committers have signed the CLA.

@aaronchantrill
Copy link
Contributor

Downloading and testing....

@aaronchantrill
Copy link
Contributor

aaronchantrill commented Feb 15, 2024

@TuxSeb I downloaded this and installed on a brand new computer last night. I tried selecting Wit.ai as my active and special stt engine. It ran fine and gave me no issues, but the transcription returned was always "<noise>" which means it was unable to identify any words.

Since this plugin requires a value in profile.yml under "witai-stt", "access_token" I would encourage you to add a settings method to this plugin. This should be something like:

def settings(self):
    _ = self.gettext
    return OrderedDict(
        [
            {
                ("witai-stt", "access_token"): {
                    "title": _("Wit.ai access token"),
                    "description": _("Your access token from https://wit.ai/")
                }
            }
        ]
    )

This will prompt the user for their access token and tell them where to get it, rather than relying on them reading the documentation and manually creating an entry in profile.yml.

Also, the documentation says to "sudo pip3 install wit" but there is no wit import so I'm not clear why. If this plugin does require a wit python package, you should add wit to the python_requirements.txt file. However, keeping a bunch of unnecessary pip installs out of the python_requirements.txt file is one of the reasons I'd like to see all of the plugins that currently do not run due to the lack of packages moved out of the Naomi default plugins and into NPE:

Plugin at '~/Naomi/plugins/stt/julius-stt' skipped! (Reason: Skipping julius, 'julius' executable not found)
Plugin at '~/Naomi/plugins/stt/google-stt' skipped! (Reason: google module not installed)
Plugin at '~/Naomi/plugins/stt/snowboy-stt' skipped! (Reason: Skipping snowboy, 'snowboydetect' module not installed)
Plugin at '~/Naomi/plugins/tts/ivona-tts' skipped! (Reason: Skipping ivona, 'pyvona' module not installed)
Plugin at '~/Naomi/plugins/tts/cereproc-tts' skipped! (Reason: Skipping cereproc, 'suds' plugin not installed)
Plugin at '~/Naomi/plugins/tts/pico-tts' skipped! (Reason: Skipping Pico, executable 'pico2wave' not found!)
Plugin at '~/Naomi/plugins/tts/mstranslator-tts' skipped! (Reason: Skipping mstranslator, "mstranslator" module not found)
Plugin at '~/Naomi/plugins/tts/festival-tts' skipped! (Reason: Skipping festival, executables "test2wave" and/or "festival" not found)
Plugin at '~/Naomi/plugins/tti/padatious_tti' skipped! (Reason: padatious module not found)
Plugin at '~/Naomi/plugins/tti/adapt_tti' skipped! (Reason: adapt module not found)

I do think we should fix pico and set it as the default tts engine since it supports French and German while flite (the current default) does not, and it is still quite lightweight and has acceptable voice quality.

I did not get a chance to run the unit tests yet. I'll try to do that this evening.

@aaronchantrill
Copy link
Contributor

aaronchantrill commented Feb 15, 2024

I should add that the reason it was not recognizing any words was that I was not using a valid token, which apparently does not generate an error, or, if it does, just writes the error to the log file.

@aaronchantrill
Copy link
Contributor

I tried the unittests and it failed, but not because of this pull request. I had found and fixed an issue a while back in pull request 391 Add Progress Bar, but then decided I wanted to try again and make the downloader use a visualization rather than just writing directly to stdout. I'm going to submit that fix in its own pull request now.

@aaronchantrill
Copy link
Contributor

I submitted my fix in pull request 396.

I checked the ~/.config/naomi/Naomi.log file and see the critical errors that should have let me know that the request was failing. I've been struggling with the logging system and when log messages should print to the screen. Right now I have all the messages from logging going to ~/.config/naomi/Naomi.log by default, which is probably a mistake on my part, since it allows errors like this to occur without notifying the user that something is wrong. This was mostly an attempt to get rid of excessive writes to stderr by the pyaudio and pyalsaaudio systems, but they aren't going through the logging system anyway, just writing directly to stderr. Luckily, the update to the audio system I have been working on seems to fix this issue by holding the input streams open rather than opening and closing them.

This pull request looks good to me. I'm ready to merge this request if you are happy with it.

@aaronchantrill aaronchantrill merged commit bb79256 into NaomiProject:naomi-dev Feb 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants