Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of matches found in knowledge base search is not correct #3822

Closed
ahoo1260 opened this issue Feb 20, 2023 · 18 comments
Closed

Order of matches found in knowledge base search is not correct #3822

ahoo1260 opened this issue Feb 20, 2023 · 18 comments
Assignees
Labels
🐛Bug Something isn't working Module: Knowledge Base
Milestone

Comments

@ahoo1260
Copy link

Describe the bug
Our knowledge base has different string properties ( for example prefLabel, altLabel, label ). We like to get the entity with closest match in all of these properties, for example, if I search for "hand", the entity with altlabel "hand" should be shown on top of list.

To Reproduce
I have attached the project and the knowledge base.
import knowledge base local with IRI Schema
After importing knowledge base is done, search "hand"

Expected behavior
it should show "Hand structure (body structure)" on top of the results for search.

same as search results as Snomed browser https://browser.ihtsdotools.org/?perspective=full&conceptId1=85562004&edition=MAIN/2023-01-31&release=&languages=en&latestRedirect=false

Screenshots

image

But we expect this order:

image

Please complete the following information:

  • Version and build ID: 26.8
  • OS: Linux (ubuntu 20.04)
  • Browser: chrome

Additional context
The project and kb file is attached

hand_project16118132736551889752.zip

vomiting_hand_graph.ttl.zip

@reckart reckart added 🐛Bug Something isn't working Module: Knowledge Base labels Feb 21, 2023
@reckart reckart added this to the 26.9 milestone Feb 21, 2023
@reckart
Copy link
Member

reckart commented Feb 21, 2023

@ahoo Thanks for the report - very insightful! I can reproduce the issue and am looking into a fix.

@reckart
Copy link
Member

reckart commented Feb 21, 2023

Is it important for you that Hand is at the top of the list or would it also be ok if it would be the preferred label of the concept, i.e. Hand structure (body structure).

Screenshot 2023-02-21 at 19 51 34

The info in gray would not be shown normally - this is debug info in the development mode.

@ahoo1260
Copy link
Author

Thanks. Preferred label is also ok! However, our annotators can be more confident if they see the exact match on the top of list ( which is hand ).

@reckart
Copy link
Member

reckart commented Feb 21, 2023

Would you then expect to see only Hand and not have Hand structure (body structure) in the list at all?

The label rendered on top of the text in the annotation bubble will always be the preferred label. I believe it would confuse the annotators if the item they chose is not the item that will be rendered in the text then.

I guess the best way would be to display in the item both, the preferred label and the label that had the best match....?Unfortunately also the more complicated solution to implement ;)

reckart added a commit that referenced this issue Feb 21, 2023
- Properly additional match labels in the SPARQLQueryBuilder
- Use the additional match labels when ranking using the LevenshteinFeatureGenerator
@ahoo1260
Copy link
Author

Is it possible to see both? it is now the preferred name and the link to Snomed. If there is no room for everything to be shown, I believe the link can be replaced by the label that had the best match...

@reckart
Copy link
Member

reckart commented Feb 21, 2023

IMHO the IRI should also remain visible because some people enter the IRI directly and they should be able to compare what they entered to the items in the dropdown.

@ahoo1260
Copy link
Author

very valid point. It is important that annotators can put the IRI

@reckart
Copy link
Member

reckart commented Feb 21, 2023

How about this:

Screenshot 2023-02-21 at 20 52 11

@ahoo1260
Copy link
Author

yes, looks exactly like what we want! Is there a reason than "hand bath" is the second match? and not "handicap"? I am trying to understand the sorting algorithm. Thank you

@reckart
Copy link
Member

reckart commented Feb 21, 2023

Ok, there is a longer story here :)

First, I had to change the settings in the project that you provided a bit - it was missing the settings to take the alternative labels into account:

Screenshot 2023-02-21 at 21 07 18

In the screenshot above, I only had added http://www.w3.org/2004/02/skos/core#altLabel yet. Then I checked the Handicap entry in the KB and it turns out that it does not have a http://www.w3.org/2004/02/skos/core#altLabel, only a http://www.w3.org/2004/02/skos/core#prefLabel and a http://www.w3.org/2000/01/rdf-schema#label - so I added the ...prefLabel as well. With both the ...altLabel and the `...prefLabel as additional matching properties, we get:

Screenshot 2023-02-21 at 21 09 40

In the gray debug info, you can see that Hand gun, Hand saw and Handicap all have the same edit distance to the query (levQuery=5 levQueryNC=4) - at which point the ordering falls back to alphabetic ordering and then comes before i.

reckart added a commit that referenced this issue Feb 21, 2023
- If the best match term differs from the KBHandle primary UI label, display it also in the dropdown
@ahoo1260
Copy link
Author

Thank you for explanation. It makes sense. I am very happy with the output

@reckart reckart self-assigned this Feb 21, 2023
reckart added a commit that referenced this issue Feb 21, 2023
reckart added a commit that referenced this issue Feb 21, 2023
…matches-found-in-knowledge-base-search-is-not-correct

#3822 - Order of matches found in knowledge base search is not correct
reckart added a commit that referenced this issue Feb 21, 2023
* release/26.x:
  #3822 - Order of matches found in knowledge base search is not correct
  #3822 - Order of matches found in knowledge base search is not correct
  #3822 - Order of matches found in knowledge base search is not correct
@reckart reckart closed this as completed Feb 21, 2023
@reckart
Copy link
Member

reckart commented Feb 21, 2023

You can try this out in INCEpTION 27.0-beta-4: https://inception-project.github.io/downloads-beta/

@ahoo1260
Copy link
Author

thank you Richard, I tested it and it works as expected. Will you make a release in the coming days?

@reckart
Copy link
Member

reckart commented Feb 22, 2023

I hope 27.0 can be released within the next 14 days - but I never give guarantees :) If for some reason it should get delayed, a 26.9 release can be added in between and that would also include the fix.

reckart added a commit that referenced this issue Feb 26, 2023
* main: (212 commits)
  No issue. Pull CSS out of HTML file and into a separate CSS file.
  #3831 - Better support a direct-access workflow
  #3831 - Better support a direct-access workflow
  #3831 - Better support a direct-access workflow
  No issue: Avoid hard crash if selection points to a non-existing feature structure.
  No issue: Formatting
  No issue: Fix endless recursion.
  No issue. Make some constants accessible.
  #3571 - Update dependencies
  #3571 - Update dependencies
  #3826 - Update dependencies
  #3783 - Ability to sort projects by created date
  #3826 - Update dependencies
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release inception-27.0-beta-4
  #3822 - Order of matches found in knowledge base search is not correct
  #3822 - Order of matches found in knowledge base search is not correct
  #3822 - Order of matches found in knowledge base search is not correct
  No issue. Reduce memory usage of test and display memory usage while test is running.
  #3793 - Ability to trigger sidebar curation mode via URL parameter
  ...

% Conflicts:
%	inception/inception-app-webapp/src/main/java/de/tudarmstadt/ukp/inception/app/config/InceptionSecurityWebUIBuiltInAutoConfiguration.java
%	inception/inception-app-webapp/src/main/java/de/tudarmstadt/ukp/inception/app/config/InceptionSecurityWebUIPreAuthenticatedAutoConfiguration.java
%	inception/inception-app-webapp/src/main/java/de/tudarmstadt/ukp/inception/app/config/InceptionServletContextInitializer.java
%	inception/inception-diam-editor/src/main/java/de/tudarmstadt/ukp/inception/experimental/editor/diamdebugeditor/DiamDebugEditorComponent.java
%	inception/inception-html-editor/pom.xml
%	inception/inception-security/src/main/java/de/tudarmstadt/ukp/clarin/webanno/security/config/SecurityAutoConfiguration.java
%	inception/inception-security/src/main/java/de/tudarmstadt/ukp/clarin/webanno/security/preauth/ShibbolethRequestHeaderAuthenticationFilter.java
%	inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/vue/VueBehavior.java
%	inception/inception-tutorial/src/main/java/de/tudarmstadt/ukp/inception/tutorial/TutorialFooterPanel.java
%	inception/inception-ui-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/annotation/config/AnnotationUIAutoConfiguration.java
%	inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/login/LoginPage.java
%	inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/page/ProjectPageBase.java
%	inception/inception-ui-curation/src/main/java/de/tudarmstadt/ukp/inception/ui/curation/sidebar/config/CurationSidebarAutoConfiguration.java
%	inception/inception-websocket/pom.xml
%	inception/inception-websocket/src/main/java/de/tudarmstadt/ukp/inception/websocket/footer/LoggedEventFooterPanel.java
%	inception/pom.xml
@reckart reckart modified the milestones: 26.9, 27.0 Feb 28, 2023
@reckart
Copy link
Member

reckart commented Feb 28, 2023

There will not be a version 26.9.

A release candidate 27.0-rc-1 is now available and you may consider testing it: https://github.com/inception-project/inception/releases/tag/inception-27.0-rc-1

@ahoo1260
Copy link
Author

ahoo1260 commented Mar 1, 2023

@reckart Is it accessible via docker ?

@reckart
Copy link
Member

reckart commented Mar 1, 2023

@reckart
Copy link
Member

reckart commented Mar 27, 2023

For future reference - when configuring INCEpTION for Snomed, the following settings should be made:

  • IRI Schema: OWL
  • Root concepts: http://snomed.info/id/138875005
  • Additional matching properties: http://www.w3.org/2004/02/skos/core#altLabel, http://www.w3.org/2004/02/skos/core#prefLabel

@reckart reckart added this to Kanban Aug 7, 2024
@reckart reckart moved this to 🍹 Done in Kanban Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Something isn't working Module: Knowledge Base
Projects
Archived in project
Development

No branches or pull requests

2 participants