NorskRegnesentral / skweak

skweak: A software toolkit for weak supervision applied to NLP tasks
MIT License
918 stars 71 forks source link

Wiki documentation error for `VicinityAnnotator` #23

Closed Zatteliet closed 2 years ago

Zatteliet commented 2 years ago

VicinityAnnotator expects a {word: label} dict for its cue_words argument, and no longer requires the label as an argument. The wiki does not agree:

# Typically, entities next to words like say/tell/listen etc. will be PERSON
cue_words = ["say", "indicate", "reply", "claim", "declare", "tell", "answer", "listen"]
VicinityAnnotator("money_detector2", cue_words, "nnp_detector", "PERSON", max_window=2)

Would be nice to fix, since following the wiki throws up unexpected and obscure errors.

plison commented 2 years ago

Thanks, it's now corrected!