Stypox / dicio-android

Dicio assistant app for Android
GNU General Public License v3.0
726 stars 69 forks source link

Feature request: Custom Synonyms for App names and Places #81

Open stefangrotz opened 2 years ago

stefangrotz commented 2 years ago

Many non-english models have problems with opening apps that have a english name, because the name does not appear in the Vosk dictionary. Also, a lot of places and cities are not recognized correctly by the models. A relatively easy workaround would be a feature that makes it possible to define synonyms for App names. This could also be useful for English speakers who have problems remembering some App names or for unknown Names that are not part of the Vosk dictionary.

Some examples:

I don't think that a predefined list of Synonyms should be part of the App, just a list that every user can define for themselves.

What do you think?

Stypox commented 2 years ago

There has already been some discussion about this in https://github.com/Stypox/dicio-android/issues/10#issuecomment-975328019. But thank you for opening a new issue, I will point to it there. I agree this should be done :-)

If anyone wants to solve this issue, they can refer to https://github.com/Stypox/dicio-android/issues/10#issuecomment-1069636411 for some information.

Stypox commented 1 year ago

Comment by @rokejulianlockhart in #142:

To verbally initialize applications, obviously, Dicio must convert whatever weirdness that the human states into the identifier of the application.

Currently, the best method appears to be to match the word to a database of synonyms when Dicio recognizes that the command is a command to invoke an application, after which those synonyms are matched to the human names of the correct application in a list of installed applications.

However, I want to suggest some important details of implementation: I want Dicio to be able to match package names. This means that if I state "[wake word], invoke/launch/initialize com.styxpox.dicio", it should recognize the application. This may appear obvious, but it does not work with some assistants.

Additionally, the database of synonyms should be automatically acquired, because manual maintenance is insane. More specifically, this means that the terminology should be acquired from an external origin and cached for offline usage.

To achieve this, the 1st few results of https://github.com/topics/synonyms?l=python&o=desc&s=updated appear promising, because when https://github.com/agmmnn/syn is queried for “telephone”, it provides:

~ $ syn phone
┌──────────────────────────────────────────────────────┐
│ ❯ telephone (verb)                                   │
├──────────────────────────────────────────────────────┤
│ 🔵synonyms: call up, contact, dial, buzz, call,      │
│ ring, get back to, get on the horn, get on the line, │
│ get someone on the horn, give a call, give a jingle, │
│ give a ring, make a call, pick up, put a call        │
│ through, ring up, touch base with                    │
└──────────────────────────────────────────────────────┘
                                          thesaurus.com↗
~ $ syn telephone
┌──────────────────────────────────────────────────────┐
│ ❯ communicate through telephone system (verb)        │
├──────────────────────────────────────────────────────┤
│ 🔵synonyms: call up, contact, dial, phone, buzz,     │
│ call, ring, get back to, get on the horn, get on the │
│ line, give a call, give a jingle, give a ring, make  │
│ a call, pick up, put a call through, ring up, touch  │
│ base with                                            │
└──────────────────────────────────────────────────────┘
                                          thesaurus.com↗
~ $

I believe that https://github.com/Stypox/dicio-android/issues/81 supplements this last point well, although it obviously should be unnecessary if decent origins exist and are chosen.

Stypox commented 1 year ago

At the moment the open skill just takes the name of the application pronounced by the user and finds the closest match within the installed apps according to a custom string distance metric based on Levenshtein.

I agree that maintaining a list of synonyms would be insane, but I don't think what we are looking for are really synonyms, but rather aliases. As explained in #81, whatsapp might be pronounced as what's app, Wort Sepp (German), messenger... whatsapp is not really a word, and it does not have real synonyms. Also, we need to map to "Whatsapp" even things that have nothing to do with it except for a similar sound (e.g. what's app). So I don't think there is a valid database we could query synonyms from.