Skip to content

Commit

Permalink
Model baseline model imports to snorkel/labeling/model (#1535)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentschen authored Jan 20, 2020
1 parent 4c36133 commit 4c227a0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 19 deletions.
6 changes: 5 additions & 1 deletion docs/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"lf.nlp.NLPLabelingFunction",
"lf.nlp.nlp_labeling_function",
"lf.nlp_spark.SparkNLPLabelingFunction",
"lf.nlp_spark.spark_nlp_labeling_function"
"lf.nlp_spark.spark_nlp_labeling_function",
"model.baselines.MajorityClassVoter",
"model.baselines.MajorityLabelVoter",
"model.baselines.RandomVoter",
"model.label_model.LabelModel"
],
"map": [
"spark.make_spark_mapper"
Expand Down
8 changes: 4 additions & 4 deletions docs/packages/labeling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Programmatic data set labeling: LF creation, models, and analysis utilities.
apply.dask.DaskLFApplier
LFAnalysis
LFApplier
LabelModel
model.label_model.LabelModel
LabelingFunction
MajorityClassVoter
MajorityLabelVoter
model.baselines.MajorityClassVoter
model.baselines.MajorityLabelVoter
lf.nlp.NLPLabelingFunction
PandasLFApplier
apply.dask.PandasParallelLFApplier
RandomVoter
model.baselines.RandomVoter
apply.spark.SparkLFApplier
lf.nlp_spark.SparkNLPLabelingFunction
filter_unlabeled_dataframe
Expand Down
6 changes: 0 additions & 6 deletions snorkel/labeling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,4 @@
from .apply.core import LFApplier # noqa: F401
from .apply.pandas import PandasLFApplier # noqa: F401
from .lf.core import LabelingFunction, labeling_function # noqa: F401
from .model.baselines import ( # noqa: F401
MajorityClassVoter,
MajorityLabelVoter,
RandomVoter,
)
from .model.label_model import LabelModel # noqa: F401
from .utils import filter_unlabeled_dataframe # noqa: F401
2 changes: 2 additions & 0 deletions snorkel/labeling/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .baselines import MajorityClassVoter, MajorityLabelVoter, RandomVoter # noqa: F401
from .label_model import LabelModel # noqa: F401
2 changes: 1 addition & 1 deletion test/labeling/model/test_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

from snorkel.labeling import MajorityClassVoter, MajorityLabelVoter, RandomVoter
from snorkel.labeling.model import MajorityClassVoter, MajorityLabelVoter, RandomVoter


class BaselineModelTest(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/labeling/model/test_label_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import torch.nn as nn
import torch.optim as optim

from snorkel.labeling import LabelModel
from snorkel.labeling.model import LabelModel
from snorkel.labeling.model.label_model import TrainConfig
from snorkel.synthetic.synthetic_data import generate_simple_label_matrix

Expand Down
8 changes: 2 additions & 6 deletions test/labeling/test_convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
import pytest
import torch

from snorkel.labeling import (
LabelingFunction,
LabelModel,
PandasLFApplier,
labeling_function,
)
from snorkel.labeling import LabelingFunction, PandasLFApplier, labeling_function
from snorkel.labeling.model import LabelModel
from snorkel.preprocess import preprocessor
from snorkel.types import DataPoint

Expand Down

0 comments on commit 4c227a0

Please sign in to comment.