Skip to content

Allow vosk alternatives.#28

Merged
Stypox merged 9 commits into
DicioTeam:masterfrom
MidnightNerd:master
Mar 10, 2022
Merged

Allow vosk alternatives.#28
Stypox merged 9 commits into
DicioTeam:masterfrom
MidnightNerd:master

Conversation

@MidnightNerd
Copy link
Copy Markdown
Contributor

@MidnightNerd MidnightNerd commented Dec 31, 2021

vosk can be configured that it shows results with lower propability. They are tried when the first result doesn't return a skill.
This should help to get less errors.
I got lags with this new version. But I'm not sure if this is the fault of this commit.

Copy link
Copy Markdown
Collaborator

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of creating a new function that handles multiple inputs, I'd just change the signatures of the onInputReceived and notifyInputReceived functions to take a List<String> (not String[]) instead of just a String as input. The input devices which produce only one alternative output could just use notifyInputReceived(Collections.singletonList(input)) and obtain the same result. The confidence parameter is not used, so just don't add it, but instead explain clearly in the javadocs that the list of inputs must be sorted by confidence, with the first item being the most confident one.

Comment thread app/src/main/java/org/dicio/dicio_android/input/InputDevice.java Outdated
Comment thread app/src/main/java/org/dicio/dicio_android/input/InputDevice.java Outdated
Comment thread app/src/main/java/org/dicio/dicio_android/input/InputDevice.java Outdated
Copy link
Copy Markdown
Collaborator

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the double review, I accidentally pressed the "Submit Review" button.
Thank you for the pull request, this could be a great improvement :-D

Comment thread app/src/main/java/org/dicio/dicio_android/eval/SkillEvaluator.java Outdated
Comment thread app/src/main/java/org/dicio/dicio_android/eval/SkillEvaluator.java Outdated
Comment thread app/src/main/java/org/dicio/dicio_android/eval/SkillEvaluator.java Outdated
@MidnightNerd
Copy link
Copy Markdown
Contributor Author

There shouldn't be any duplicated code anymore.
I didn't implemented
getBest(List<String>, List<List<String>>, List<List<String>>) as this would requires one loop in skillevaluator to create the List<List<String>> and a second in skillranker to get the List<String> back.

Copy link
Copy Markdown
Collaborator

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you solve this and the other comment about documentation, this is ready to merge, thank you!

Comment thread app/src/main/java/org/dicio/dicio_android/eval/SkillEvaluator.java Outdated
MidnightNerd and others added 5 commits March 9, 2022 12:04
Vosk can output alternative outputs with less confidence. These outputs are used when there's no skill matching to the first input.
@Stypox
Copy link
Copy Markdown
Collaborator

Stypox commented Mar 10, 2022

I pushed some commits, fixing the comments I made above, reformatting the code and fixing a couple of small things. Thank you for the contribution, this seems to really help sometimes!

@Stypox Stypox merged commit b5762e4 into DicioTeam:master Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants