:param update: Whether to incrementally add/update new values.
:param lfs: The list of functions to use to generate labels.
logger.debug("Document: {}".format(doc))
if lfs is None:
raise ValueError("Must provide lfs kwarg.")
After Change
raise ValueError("Please provide a list of labeling functions.")
if len(lfs) != len(self.candidate_classes):
raise ValueError("Please provide LFs for each candidate class.")
self.lfs = lfs
if docs:
// Call apply on the specified docs for all splits
split = ALL_SPLITS
super(Labeler, self).apply(
docs, split=split, train=train, lfs=self.lfs, clear=clear, **kwargs
)
// Needed to sync the bulk operations
self.session.commit()
else:
// Only grab the docs containing candidates from the given split.
split_docs = get_docs_from_split(
self.session, self.candidate_classes, split
)
super(Labeler, self).apply(
split_docs,
split=split,
train=train,
lfs=self.lfs,
clear=clear,
**kwargs
)
// Needed to sync the bulk operations
self.session.commit()
def get_lfs(self):
Return a list of lists of labeling functions for this Labeler.
return self.lfs