by azinman2 · 6y ago · 0 comments
I do a lot of text classification where I'm working with a set of semi-structured sample documents. I can usually hard-code rules to classify my sample set, but I know that any new sample document might well break my rules. Typically, I know a handful of things about what distinguishes some documents from others-- some I know will always be true but many I only know will sometimes be true. The naive way to handle this tends to be a score-based approach, where documents get "points" for meeting certain criteria. But unless it turns out that stuff you thought was sometimes true is always true and/or the things that are always true are enough to classify correctly 100% of the time, the naive approach is always going to regress (no pun intended) to a model because you have to identify a cutoff for your scoring. You can take statistical approaches to figuring out the best cutoff to achieve the result you want (e.g. a Principal Component Analysis optimized for a certain chi-square distribution), but it's still turning into a modeling task no matter what you wanna call it.
It's great to be able to dump all of my roughly understood features into Snorkel and let it build a model around them. It's also super fast because I've usually already written the hard-coded "rules", so I have very little new code to write.
Usually the classifier ends up being a supplement to what I'm already doing but in certain cases it could become an outright replacement.
There are other tasks where the right decision might be to go get a bunch of human-labeled examples -- an example I like to think of is how you would describe a chair, if you didn't have any object detectors lying around. That's a situation where a) it's hard for a human to describe what you're looking for, and b) you would potentially get more bang for your buck by just having an army of Turkers label a bunch of chairs for you, since everyone knows what a chair is.
Quite magic.