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

Alter NGramDocuments' n-grams to consist of vectors of tokens or be handled like string docs? #261

Open
mostol opened this issue Feb 18, 2022 · 0 comments

Comments

@mostol
Copy link

mostol commented Feb 18, 2022

I was looking into #149 and realized that the underlying problem is an assumption that NGramDocuments' n-grams are made up of individual tokens, but each n-gram is actually just a single, regular string (hence the unexpected stemming behavior).

It might be worth considering altering NGramDocument to contain vectors of strings (i.e. tokens) or to make the behavior of the n-grams align more with how StringDocuments are treated. Or, if it would make more sense, we could also just make NGramDocuments actually consist of TokenDocuments or StringDocuments. Personally, I think I would lean towards making the n-gram a vector of strings or its own TokenDocument—that seems to make the most sense for the actual meaning of an n-gram.

With any approach, it looks like, fundamentally, all this would take to implement would be to update the way a "token" of an n-gram is defined in ngramizer.jl. I'd be glad to implement this (and fix the other issue mentioned) if people think this is worth pursuing! I'm just not sure which direction would be most beneficial, or if it would introduce any unforeseen issues.

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

1 participant