dicio-android icon indicating copy to clipboard operation
dicio-android copied to clipboard

Feature request: Custom Synonyms for App names and Places

Open stefangrotz opened this issue 2 years ago • 4 comments

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:

  • Semantic synonymes: Whatsapp -> Text Messenger
  • Adding wrong transcriptions that often happen: WhatsApp -> what's app, Wort Sepp (German),...
  • Switching the Alphabet: WhatsApp -> WхатсАпп

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?

stefangrotz avatar May 18 '22 18:05 stefangrotz

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 avatar May 22 '22 20:05 Stypox

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 avatar Jan 11 '23 11:01 Stypox

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.

Stypox avatar Jan 11 '23 11:01 Stypox

As someone who has apps that don’t have an English name, it would be nice to just select an app from a list inside the Dicio app, and add a custom alias to it, like adding a text shortcut for typing.

e.g. For the カラオケ館 app, I could add “the karaoke membership app” as an alias, which would teach Dicio to open it when I say “Open the karaoke membership app”.

JapanYoshi avatar May 14 '23 01:05 JapanYoshi