Live data from Hacker News

Bag of Tricks for Efficient Text Classification

arxiv.org

11–16 of 16 posts

Re: Bag of Tricks for Efficient Text Classification

#11
post #5

For anyone who is interested in efficiently classifying text, I can't recommend Vowpal Wabbit[1] (VW) enough. It's blazingly fast and has been used in both production and research. It also has a billion options out of the box for various different set-ups. Other researchers have noted[2] that with a set of command line flags that vw is almost the same as the system described in the paper, specifically, "vw --ngrams 2…

Note that the fact that this can be easily accomplished in VW doesn't really take away from the message the authors are trying to make; namely, simple models done carefully are nearly as (or more) effective in these sorts of problems as fancy deep models, but much cheaper to train and test.

Re: Bag of Tricks for Efficient Text Classification

#12
I don't understand why they're doing this on the Yelp/IMDB datasets. Here's the paper they're citing that is doing the same thing with gated neural nets: http://www.emnlp2015.org/proceedings/EMNLP/pdf/EMNLP167.pdf

However that paper also has the polar score which is a 2-class classifier - 1 star + 2 star vs 3 star + 4 star.

Basically, the rating scores are clearly ordinal, but they're completely disregarding that information as if a 4 is a completely different star review than a 5 in a yelp restaurant review or a 9/10 is different from 8/10 for IMDB review.

More useful estimate of success would be how close they got to real rating and possibly penalize disproportionately when a model gets the rating completely wrong. Something like mean squared error of the final score vs predicted score.

I understand that these are just used to benchmark the algorithms against each other, but why not use something more relevant like a topic classification? That is a real n-classes problem.

General disregard for domain-specific information is very prevalent in machine learning papers and it makes real world applications difficult because real world evaluation metrics are different so classifiers that are marked as inferior in such evaluation might actually be better.

In both of their evaluations, why not try

    F(y) = exp(yj) / sum(exp(yi) for i in range(1, n+1))
    p1 = F(y1)
    pj = F(yj) - F(yj-1), for j ≥ 2
for softmax? In other words, subtract cum prob of previous category.

Or use kappa function?

At least the naive bag of words comparison classifier should have used ordinal logistic regression instead of n-class logistic classifier.

Re: Bag of Tricks for Efficient Text Classification

#13
post #5

For anyone who is interested in efficiently classifying text, I can't recommend Vowpal Wabbit[1] (VW) enough. It's blazingly fast and has been used in both production and research. It also has a billion options out of the box for various different set-ups. Other researchers have noted[2] that with a set of command line flags that vw is almost the same as the system described in the paper, specifically, "vw --ngrams 2…

Note that the fact that this can be easily accomplished in VW doesn't really take away from the message the authors are trying to make; namely, simple models done carefully are nearly as (or more) effective in these sorts of problems as fancy deep models, but much cheaper to train and test.

This is implied through research on reductions in machine learning.

That simple models can solve complex tasks.

For example, you can do multiclass classification, cost sensitive (importance weighted) multiclass and binary, quantile regression, structured prediction (as is done with HMMs, CRFs, MEMMs, structured SVMs etc.), just using a binary classifier.

So, if your implementation of that binary classifier is efficient and performant, you'll be (given that your reduction is consistent) efficient and performant on any of the above tasks.

What the authors of the paper above did, is that they rediscovered some old tricks, removed the theory of reductions, and that's that - without referencing vowpal wabbit that does way more useful tricks. I'm not sure why, because VW team consistently references Leon Bottou (out of all others) that is member of FAIR, and has been using implementation tricks for decades.

Their log(k) implementation is probably less performant than the one-against-some consistent reduction in VW due to the latter having better theoretical bounds on performance.

Re: Bag of Tricks for Efficient Text Classification

#14
post #9

Earlier quoted context omitted.

Imagine looking at an image as a "bag of pixels": shuffle them all up, and look at the resulting image. What do you see? Nothing useful, right? Now look at a bag-of-words view of a movie review: set(['and', 'predecessor,', 'immersive;', 'script,', 'is', 'an', 'engaging', 'as', 'home', 'still', 'its', 'film', 'identity.', 'puts', 'dazzling', 'issues', 'visually', 'colorful', 'While', 'not', 'spin', 'on', 'of', 'while'…

I think bag of pixels would be more analogous to a bag of characters. A bag of words is more like a bag of SIFT features.

Sure but n-gram feature extraction is what, five lines of code? It's a trivial transform compared to SIFT.

If you don't do SIFT manually prior to classification then your NN has to evolve something "similar" in order to work. Which is why it needs to be deep.

Re: Bag of Tricks for Efficient Text Classification

#15
post #5

For anyone who is interested in efficiently classifying text, I can't recommend Vowpal Wabbit[1] (VW) enough. It's blazingly fast and has been used in both production and research. It also has a billion options out of the box for various different set-ups. Other researchers have noted[2] that with a set of command line flags that vw is almost the same as the system described in the paper, specifically, "vw --ngrams 2…

Note that the fact that this can be easily accomplished in VW doesn't really take away from the message the authors are trying to make; namely, simple models done carefully are nearly as (or more) effective in these sorts of problems as fancy deep models, but much cheaper to train and test.

I can attest to that: used even simpler algorithm with bi-gram hasing to generate user profile for http://news-AI.com presonalized news service.

Surprisingly, it produced satisfactory results with much smaller CPU requirements.

Re: Bag of Tricks for Efficient Text Classification

#16
post #6

Earlier quoted context omitted.

Thanks for the detailed comment! It's interesting that simple and classical techniques are so competitive for text, but not for images. What do you think is different about text that makes simple methods so effective, or equivalently what is different about images that yields such massive improvements from using convolutional deep neural nets?

Imagine looking at an image as a "bag of pixels": shuffle them all up, and look at the resulting image. What do you see? Nothing useful, right? Now look at a bag-of-words view of a movie review: set(['and', 'predecessor,', 'immersive;', 'script,', 'is', 'an', 'engaging', 'as', 'home', 'still', 'its', 'film', 'identity.', 'puts', 'dazzling', 'issues', 'visually', 'colorful', 'While', 'not', 'spin', 'on', 'of', 'while'…

"This movie make all other movies look awful - do not fail to see, missing it would be a crime"

Is this a negative, or a positive review?

awful -1 fail -1 miss[ing] -1

Seems pretty negative to me...

You can build a fairly accurate nudity filter by detecting % skin-tone pixels, but that extra mile to distinguish bikini/beach pics from nudes is the real crux.

Post reply on HN