Live data from Hacker News

Snorkel AI: Putting Data First in ML Development

snorkel.ai

41–50 of 67 posts

Re: Snorkel AI: Putting Data First in ML Development

#41
post #34

Myself and a few colleagues attended the _absolutely packed_ presentation the Snorkel folks did at ODSC in Boston last year and came away so convinced by this approach that we actually constructed our interns summer project around using Snorkel for multi-label classification on complex very domain specific financial documents. The project was successful and both us and our intern were very happy. The main lessons lea…

can you educate me on how you do multi-label w/ snorkel? As far as I can understand that's one it's largest drawbacks.

Fair question. I didn't personally supervise our last intern, it was my turn the summer before, so I'm not as deeply familiar with it. Now that you bring this up though, I think perhaps I may have misspoken. When I said muti-label, I think that was our goal originally, but because of the constraints of Snorkel you mentioned, we ended up reframing the problem into many single class models instead. They would both work, but because of how our business users worked, multi-label wasn't super important. For example, not all business users are interested in every label, so I think what happened was more than one model was trained, one for each label, and then ensembled based on the business users interests. Our final output allowed users to effectively sort, filter, and search documents based on any combination of these labels. Keep in mind too, some of these labels are fairly abstract, so just one of them was fairly powerful by itself and could perhaps power an entire team in some cases. I hope that helps, I'm sorry I can't go into too much more detail.

Re: Snorkel AI: Putting Data First in ML Development

#42
post #39

I can see how this would work for tabular and text data, where the labeling functions are well-defined. I don't understand, at all , how this would work with computer vision tasks where heuristics are pretty much impossible to define. That said, I don't see anything here that would prevent you from using a pre-trained conv net as a labeling function, but I expect that multiple conv nets trained on a small corpus of d…

At the ODSC presentation I went to last year where the team presented they actually used a vision problem as their canonical example. It's hard to grasp without a concrete example, but it makes a lot of sense the way they explained it.

For example, lets assume you want to identify something like a lung tumor. So you have many MRI images and they're all largely the same template of image. Using traditional image processing software like open CV, it's suprisingly easy to do more coarse grained tasks programmatically, like say, search this image for any circle that's brighter than the surrounding tissue and has a radius greater than say x.yz mm. If you find one, that function returns True if not False. That x.yz mm number is what you get from your radiologists that you work with to help you develop the labeling functions and this is just _one_ of the labeling functions. But basically it turns out if you construct a few of these functions with the help of domain experts and then use those functions all together with the information theory research the Snorkel folks do, you get pretty damn good performance!

Re: Snorkel AI: Putting Data First in ML Development

#43
Hi all, this is Alex from the Snorkel team- thanks for all the great comments! Excited to respond to a few questions directly, but first highlighting some up here:

- Where to find more about the core Snorkel concepts: We've published 36+ peer-reviewed papers, along with blog posts, talks, office hours, etc over the years (see https://www.snorkel.ai/technology and https://www.snorkel.ai/case-studies), so I'll defer somewhat to those... but of course, academic papers can be painful to read (even when you wrote them!), so happy to also answer questions here.

- What Snorkel Flow is: Snorkel Flow is an end-to-end ML development platform based around the core idea that training data is the most important (and often ignored) part of ML systems today, and that you can label, build, and manage it programmatically with the right supporting techniques. This is based on our research at Stanford, where we spent several years exploring the basic question: can we enable subject matter expert users to train ML models with things like rules, heuristics, and other noisy sources of signal, expressed as "labeling functions" and other types of programmatic ops (ex: 'label this document X if it overlaps with dictionary Y'), instead of having to hand-label training data. This type of input, often termed "weak supervision", ends up requiring a lot of work to deal with as it is much noisier than hand-labeled data (eg the labeling functions can be inaccurate, differ in coverage and expertise, have tangled correlations, etc) but can be very powerful if you model it right! And Snorkel Flow specifically is focused on actually making the broader end-to-end process of building and managing ML with programmatic training data usable in production, rather than just on exploring the algorithmic and theoretical ideas as was the goal of our research/OSS code over the years!

- Why train a model if you have a programmatic way to label the data: In Snorkel, the basic idea is to label some portion of the data with labeling functions (usually it's hard to label all of the data- hence the need for ML), and then use ML to generalize beyond the LFs. In this sense Snorkel is an attempt to bridge rules-based approaches (high precision but low recall) and stats learning-based approaches (good at generalizing). This is also useful in "cross-modal" cases where you can write LFs over one feature set not available at inference time, but use them to train a model that does work on the servable/inference time features (e.g. text to image is one recent example https://www.cell.com/patterns/fulltext/S2666-3899(20)30019-2). But, of course, we believe in an empirical process all the way, which is another reason we like the Snorkel approach: if you can write a perfect set of labeling functions, then great- you don't need a fancy ML model, stop there!

- Does Snorkel work??: As an ML systems researcher, I'm always a bit perplexed by this question... the relevant questions for any system or approach are usually 'When/where might it be expected to be useful, and what are the relevant tradeoffs?' We've done our best to answer these questions over the years with theory, empirical studies, etc (see links above), and of course its very case specific. But one thing I'll note is that Snorkel is not a push-button automagic approach that takes in garbage and produces gold. It's our attempt to define a new input / development paradigm for ML--one which we've shown can often be orders of magnitude more efficient--but like any development process, it requires effort and infrastructure to use most successfully! Which is a big part of why we've built Snorkel Flow- to support and accelerate this new kind of ML development process.

- Who uses Snorkel? A few that have a published record: Google, Intel, Microsoft, Grubhub, Chegg, IBM... and many others at very large and smaller orgs that are not public

- What is going to happen with the OSS: The OSS project will remain up and open under Apache 2.0, same as all of the other research work we've put out over the years! See our community spectrum chat for more.

Re: Snorkel AI: Putting Data First in ML Development

#44

Myself and a few colleagues attended the _absolutely packed_ presentation the Snorkel folks did at ODSC in Boston last year and came away so convinced by this approach that we actually constructed our interns summer project around using Snorkel for multi-label classification on complex very domain specific financial documents. The project was successful and both us and our intern were very happy. The main lessons lea…

Thanks for this kind note! Would love to chat sometime and hear about your findings working with Snorkel- pros, cons, feature requests, etc. Multi-label is one on our list and under development (see comments below and elsewhere), would be interested to trade notes!

Re: Snorkel AI: Putting Data First in ML Development

#45
post #39

I can see how this would work for tabular and text data, where the labeling functions are well-defined. I don't understand, at all , how this would work with computer vision tasks where heuristics are pretty much impossible to define. That said, I don't see anything here that would prevent you from using a pre-trained conv net as a labeling function, but I expect that multiple conv nets trained on a small corpus of d…

First: Snorkel Flow absolutely does not generalize to every ML problem :). IMO defining where different systems and approaches do and don't work best is one of the most important and most challenging problems in ML systems research- as noted, we've worked to give detail on this for Snorkel over the years... no perfect answers, but some notes below:

- As you imply, a lot has to do with the available sources of input signal- whether labeling functions, or 'transformation functions' for data augmentation, or other ops we've worked on... the input is obviously key.

- For data modalities like image, video, etc: Often the most successful approach is to (A) rely on some pre-processed features or "primitives" and write labeling functions over these- as my co-founder Paroma in particular has published about over the years- and/or (B) use metadata

- External models are definitely expressable as labeling functions, and we've worked on exactly that problem of modeling (local) biases and correlations!

Re: Snorkel AI: Putting Data First in ML Development

#46
post #36

As another option, Compose is a ML tool for labeling data. It structures the labeling process and integrates easily with Featuretools which automates feature engineering. Definitely worth checking out! [1] https://github.com/FeatureLabs/compose [2] https://github.com/FeatureLabs/featuretools

can you do multi-label w/ Compose? Snorkel only supports single-label.

Yes, you can represent the labeling function as a class and use its methods to represent each label individually.

Re: Snorkel AI: Putting Data First in ML Development

#47
post #24

anyone figure out how to do multi-label classification w/ snorkel? It seems like it's current formulation only supports single-label, ie softmax. I find in practice, especially w/ user-interaction, system most problems are not single-label, but multi-label. Also, in the single-label setting it's often necessary to define an negative "OTEHR" class which is very difficult to define w/ snorkel in my experience.

Single label has been the applicable one for most of the applications we've tackled to date, but agreed that multi-label is also very important! More coming here soon...

Re: Snorkel AI: Putting Data First in ML Development

#48
post #11

I have a question for the snorkel folks if they're lurking here. With noisy label functions for large amounts of data, I could easily see the cases where the label functions fail correlating with classes that are already having a hard time (disadvantaged/underrepresented/marginalized groups, etc). Has there been any work on using these tools while making sure to avoid dangerous biases? It seems like the kind of tool…

Lurking for a few more min... great question! Dealing with both class imbalance and issues of pernicious biases in both underlying data distributions and training labels is an extremely important topic. Our underlying theory deals with local biases (e.g. individual labeling functions or sources of training signal being biased) but systemic biases (e.g. the user driving the system being biased) are certainly tougher.

One important and practical answer that we've found: with an approach like in Snorkel Flow, you can inspect the source of the training data and correct it if biased- which you just can't do with e.g. a million hand labeled training data points. So in practice this is a big advantage we've found.

On the theory / research side, this is definitely an area we want to pursue further!

Re: Snorkel AI: Putting Data First in ML Development

#49

What does it actually do? I know "label data" but anything can do that. Is it just a pipeline system with some helpers for running a couple of ML related functions? Is it UI based? Where do you run it? I know these areas well and got nearly nothing from reading the splash page on the site.

I also have problems understanding what exactly it does. I just briefly skimmed the paper, but it seems like the idea is as follows. Assuming you don't have ground truth labels for your data: 1. Generate many different nosiy labels for your data by writing functions. These don't need to be correct, but they should make uncorrelated errors. They are basically domain knowledge you have of your data. 2. Snorkel takes th…

The description reminds me a bit of learning classifier systems.

Edit: and a bit of fuzzy rule systems. Which just goes to suggest that I am probably well out of my depth.

Re: Snorkel AI: Putting Data First in ML Development

#50
post #35
post #21

Earlier quoted context omitted.

If anyone is looking for an open source library in this space, I work on one called Compose ( https://github.com/FeatureLabs/compose ). With compose, a user defines a labeling function, and then compose scans the historical data looking for training examples to train a machine learning model. The library has evolved as we apply it to more and more real world use cases, but it is based on approach in this paper from 2…

can you do multi-label w/ Compose? Snorkel only supports single-label.

Yes, you can represent the labeling function as a class and use its methods to represent each label individually.
Post reply on HN