[ENH] Match Keywords in Widget Search#3117
Conversation
|
Note: Most widgets currently do not hold keyword data. |
|
A very important improvement. Thank you for working on it! |
lanzagar
left a comment
There was a problem hiding this comment.
I started writing some suggestions for individual keywords, but will stop for now.
I think the functionality is a very good enhancement, and we can go over the list of actual keywords in another PR. Maybe after some discussion with others.
The only drawback I see to this approach is that currently the matches in names and keywords are treated equally so this can make it harder to get to a specific widget for which I know the name. The other PR (#3112) which addresses sorting of suggestions could prevent this, by sorting all the exact matches above keyword matches.
Orange/widgets/data/owconcatenate.py
Outdated
| description = "Concatenate (append) two or more datasets." | ||
| priority = 1111 | ||
| icon = "icons/Concatenate.svg" | ||
| keywords = ["append", "join"] |
Orange/widgets/data/owmergedata.py
Outdated
| description = "Merge datasets based on the values of selected features." | ||
| icon = "icons/MergeData.svg" | ||
| priority = 1110 | ||
| keywords = [] |
There was a problem hiding this comment.
you could add "join" here as well, like for Concatenate
Orange/widgets/data/owsave.py
Outdated
| icon = "icons/Save.svg" | ||
| category = "Data" | ||
| keywords = ["data", "save"] | ||
| keywords = ["save"] |
There was a problem hiding this comment.
this is already part of the name isn't it
| "data features, classes or meta variables." | ||
| icon = "icons/SelectColumns.svg" | ||
| priority = 100 | ||
| keywords = ["attributes"] |
There was a problem hiding this comment.
if attributes, then maybe also "variables" and "features"
but "filter" is probably something users would try too
Orange/widgets/data/owselectrows.py
Outdated
| icon = "icons/SelectRows.svg" | ||
| priority = 100 | ||
| category = "Data" | ||
| keywords = [] |
Orange/widgets/model/owconstant.py
Outdated
| "Orange.widgets.regression.owmean.OWMean", | ||
| ] | ||
| priority = 10 | ||
| keywords = [] |
| "Orange.widgets.regression.owlinearregression.OWLinearRegression", | ||
| ] | ||
| priority = 60 | ||
| keywords = [] |
There was a problem hiding this comment.
"ridge", "lasso", "elastic net"
| "quality estimation." | ||
| icon = "icons/KMeans.svg" | ||
| priority = 2100 | ||
| keywords = ["means", "kmeans"] |
There was a problem hiding this comment.
"means" is unnecessary as that worked before keywords already... The names are split into words so k-Means matched k and Means (and prefixes).
I would add "clustering" however.
|
Another comment: a commit like 6d5f8c3 (reimplemented title matching) is usually not useful to have in the git history. When fixing/improving/reworking your own changes you should squash the commits into one containing the final version. |
|
I see that to some widgets empty keywords were added. Widgets should also work properly if the keywords were not defined (as it is the case of most current add-on). Commits with undefined keywords (keywords = []) should be removed from this PR. |
|
|
||
| # match name and keywords | ||
| accepted = False | ||
| for keyword in [name] + keywords: |
There was a problem hiding this comment.
How about also iterating over filter(None, re.split(r'\W+', description.description.lower()))? This way, many widgets won't even need separate keywords, e.g. K-means already has "clustering", "silhouette", ...
There was a problem hiding this comment.
I'd rather manually set keywords to be able to finely control what shows up in search, avoiding the overcrowding of search results. Each widget shouldn't need more than a few keywords I think.
|
To clarify, widgets work properly without keywords defined (even without an empty list of keywords). I just added an empty list in case someone notices it in the future and thinks of something good to fill it with. |
Issue
At the moment, searching for widgets only queries widget titles. This leads to one having to type the widget's exact name to find it (e.g. "k-means"). With searching by keyword, widgets can be assigned other tags (e.g. "means", "kmeans").
Description of changes
Overriding filterAcceptsRow() in quick menu, matching both keywords and widget title.
Includes