Replies: 2 comments 7 replies
-
|
This is not built in, but i think it should be easy to verify? E.g.: import bm25s
query = "what are cats?"
doc = "Cats are animals"
query_tokens = set(bm25s.tokenize(query, return_ids=False)[0])
doc_tokens = bm25s.tokenize(doc, return_ids=False)[0]
matches = [1 if dt in query_tokens else 0 for dt in doc_tokens] |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
I would like to second the addition of this functionality. In my use case I need to make sure the documents returned by I think it would be very useful to have the Thank you. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We're trying to display some highlighting in the UI based on which tokens match. I can't find any method that returns the matching tokens from a query, but wanted to confirm? Ideally we'd have something in the
resultsobject from the callresults, scores = retriever.retrieve(...)so we would know thatdocument ID #123had tokens["fish", "cat"]?Thank you
Beta Was this translation helpful? Give feedback.
All reactions