snorkel-team / snorkel

A system for quickly generating training data with weak supervision
https://snorkel.org
Apache License 2.0
5.81k stars 857 forks source link

Inconsistency between documentation and module #1577

Closed TrigonaMinima closed 4 years ago

TrigonaMinima commented 4 years ago

Issue description

Following through the getting started page, the following import statements are giving me import errors

from snorkel.labeling import LabelModel, PandasLFApplier

# produces
# ImportError: cannot import name 'LabelModel' from 'snorkel.labeling'

What worked for me instead was:

from snorkel.labeling import model
from snorkel.labeling.apply import pandas as apply
...
model.LabelModel()
apply.PandasLFApplier()

System info

johncalab commented 4 years ago

Yeah, I had the same issue. I pip installed 0.9.3, which is the version used in the tutorials and it worked.

vincentschen commented 4 years ago

You're right — the tutorials (and website link) are not up to date with the latest version of Snorkel Flow.. we'll get this resolved shortly!

vincentschen commented 4 years ago

thanks for raising — this should now be resolved with https://github.com/snorkel-team/snorkel-tutorials/pull/216!

EasonC13 commented 3 years ago

You can try this instead. It works for me.

from snorkel.labeling.model.label_model import LabelModel

You can check the latest document for how to import the module you want.

https://snorkel.readthedocs.io/en/v0.9.7/packages/_autosummary/labeling/snorkel.labeling.model.label_model.LabelModel.html