rodekruis / helpful-information

A web-app for People Affected to lookup useful organizations and information.
Apache License 2.0
2 stars 2 forks source link

Improve search algorithm #435

Open elwinschmitz opened 2 years ago

elwinschmitz commented 2 years ago

Currently the search-feature uses a (case-INsensitive) RegEx-matching algorithm like: If <search input> can be found as-is ANYWHERE in the Answer- OR Question-fields of a Q&A-set. So for example:

Maybe more intuitive would be to match ANY keyword (by splitting the input on spaces) found anywhere in the Question/Answer. So for example:

See #286 See #433

elwinschmitz commented 2 years ago

Also:

Add a "relevance"-score to each result, so we can sort the results on it.

For example a level of relevance could be: ("number of matches in the answer" * 10) + ("number of matches in the question" * 1) =

Other things to consider:

jmargutt commented 2 years ago

There are fancy semantic search models that can be deployed without re-training them, e.g. https://www.sbert.net/examples/applications/semantic-search/README.html Much more robust than RegEx. But need to be hosted, cannot run on client-side

elwinschmitz commented 2 years ago

Note to self: See PowerPoint-file: "HIA FAQ UT 2 presentation 26092022"

elwinschmitz commented 1 year ago

Also an option: Using a (commercial) third-party service.

Like: https://www.algolia.com/

Or: https://alternativeto.net/software/algolia/ ;)

elwinschmitz commented 1 year ago

Other options for third-party search tools: https://patrickposner.dev/tutorials/search-on-a-static-site/

elwinschmitz commented 1 year ago

Use https://fusejs.io/ ?

elwinschmitz commented 1 year ago

Possibly, to create a "chatbot-as-a-search"-feature: https://azure.microsoft.com/en-us/products/cognitive-services/question-answering/

elwinschmitz commented 1 year ago

Another option, maybe: https://lunrjs.com/

jmargutt commented 1 year ago

@elwinschmitz we were approached by Deloitte who's looking for a data science project as part of their CSR, see this convo. The "chatbot-as-a-search" might be part of it, although the use case needs to be refined with @JLijftogt .

elwinschmitz commented 1 year ago

For Future Reference: When going the static-generator route(See #552): Use https://pagefind.app