HazyResearch / fonduer

A knowledge base construction engine for richly formatted data
https://fonduer.readthedocs.io/
MIT License
409 stars 77 forks source link

Support decorated labeling functions #401

Closed HiromuHota closed 4 years ago

HiromuHota commented 4 years ago

062a6ecdefb6f129fc28dde6015daddb8f5ac004 demonstrates #400 . This PR as a whole will fix #400.

codecov-io commented 4 years ago

Codecov Report

Merging #401 into master will decrease coverage by 0.02%. The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #401      +/-   ##
==========================================
- Coverage   82.49%   82.46%   -0.03%     
==========================================
  Files          86       86              
  Lines        4353     4357       +4     
  Branches      804      806       +2     
==========================================
+ Hits         3591     3593       +2     
- Misses        572      573       +1     
- Partials      190      191       +1     
Flag Coverage Δ
#unittests 82.46% <20.00%> (-0.03%) :arrow_down:
Impacted Files Coverage Δ
src/fonduer/supervision/labeler.py 69.46% <20.00%> (-2.19%) :arrow_down:
src/fonduer/candidates/models/span_mention.py 77.45% <0.00%> (+1.96%) :arrow_up:
HiromuHota commented 4 years ago

In addition to supporting decorated labeling functions, I'd suggest to deprecate undecorated ones as of v0.9.0. @SenWu, @lukehsiao , Please let me know your thoughts.

lukehsiao commented 4 years ago

That makes sense to me if it helps users avoid complications when working with snorkel.

HiromuHota commented 4 years ago

Thank you @lukehsiao for you input!

One correction: I'd suggest to deprecate undecorated ones as of v0.8.2 and remove the support for them as of v0.9.0. This means that both decorated and undecorated LFs work with v0.8.2 but only decorated ones would work with v0.9.0.