What is the logic/algorithm behind 'did you mean' suggestion by search engines, command suggestion in command prompt like git?

For eg. https://stackoverflow.com/questions/307291/how-does-the-google-did-you-mean-algorithm-work this is the logic behind google's did you mean algorithm - used for spell correction suggestion. What is the algorithm used in case of other search algorithm for spell correction/ to find similar text - in case of a music/OTT search app, eg. amazon music -

Similarly - what is the logic used - in case of git commands -

How do one usually backtrack the algorithm behind an application from usage? Any general ideas will also be helpful.

Topic text nlp similarity search

Category Data Science


This is a combination of text similarity measures and a large database of popular queries.

It's quite easy in the case of small closed sets, like git commands: there are only a few possible commands, so the whole matrix of similarities can be predefined or even calculated on the fly with the query. The most similar option(s) are then proposed.

In the case of major search engines they certainly have a massive database of frequent queries, and possibly predefined groups of similar queries to make the suggestions appear quickly.

How do one usually backtrack the algorithm behind an application from usage?

It's simply impossible, unless you have access to the code (git is open-source for example) you have to redesign the whole thing.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.