Skip to content

Instantly share code, notes, and snippets.

@vikeshsingh37
Created April 5, 2020 14:38
Show Gist options
  • Save vikeshsingh37/1178744458f9752224ce0672091b749e to your computer and use it in GitHub Desktop.
Save vikeshsingh37/1178744458f9752224ce0672091b749e to your computer and use it in GitHub Desktop.
from snorkel.slicing import slicing_function
@slicing_function()
def short_link(x):
"""Return whether text matches common pattern for shortened ".ly" links."""
return int(bool(re.search(r"\w+\.ly", x.text)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment