-
Notifications
You must be signed in to change notification settings - Fork 842
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
feat: Add VowpalWabbit ngram support #696
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report
@@ Coverage Diff @@
## master #696 +/- ##
==========================================
+ Coverage 79.99% 80.03% +0.04%
==========================================
Files 229 229
Lines 9118 9142 +24
Branches 469 470 +1
==========================================
+ Hits 7294 7317 +23
- Misses 1824 1825 +1
Continue to review full report at Codecov.
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve with nits
src/main/scala/com/microsoft/ml/spark/vw/VowpalWabbitFeaturizer.scala
Outdated
Show resolved
Hide resolved
src/test/scala/com/microsoft/ml/spark/vw/VerifyVowpalWabbitClassifier.scala
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Vowpal Wabbit supports on-the-fly ngram generation, thus the featurized dataset does not need to contain the ngrams and will not blow up in memory. Minor complication in all of this is that the features are already hashed in the SparseVector and unfortunately always get sorted by the Spark SparseVector implementation.
To overcome this the sparse indices get prefixed with a counter at the highest level bits. The number of bits for the counter can be configured, but together with the hashing bits need to fit within 30 bits (yeah, signed integers). The prefix counter is stripped by VW JNI layer as the bit mask is always re-applied.