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

add a class to index multiple documents #12

Open
louisabraham opened this issue Feb 27, 2020 · 2 comments
Open

add a class to index multiple documents #12

louisabraham opened this issue Feb 27, 2020 · 2 comments

Comments

@louisabraham
Copy link
Owner

See my proposal and code in debatem1/pydivsufsort#4

@grantjenks
Copy link

Fwiw, I didn't see the get_document_index API but implemented something similar to the bisect-based approach.

In my case, I have a few hundred thousand documents each with a few thousand tokens. After a learning pass to convert the tokens to integers, an additional integer is created for each document. The array of integers is then constructed as: "doc_token1,num1,num2,...,doc_token2,num3,num4,..." and fed to the suffix array and longest common prefix functions. A second linear pass stores the index of each document token number so that it can be bisected. It's hard to keep track of all the indexes and prefixes and suffixes and whatnot but it's fast!

@louisabraham
Copy link
Owner Author

Very interesting, don't hesitate to share your code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants