Github user feynmanliang commented on the pull request:
https://github.com/apache/spark/pull/6887#issuecomment-113951123
I actually think @mengxr suggestion makes sense; it guarantees that the
output is an actual n-gram rather than being dependent on whether the input
length > n or not.
Another possibility could be to pad with some null word. The use cases I am
imagining is a n-gram HMM language model, in which case partial sentences with
k words (k < n) should be represented by padding null words on the right.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]