Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Last active June 28, 2020 18:05
Show Gist options
  • Save aniruddha27/f870032621ea9c0349a47969d85445cc to your computer and use it in GitHub Desktop.
Save aniruddha27/f870032621ea9c0349a47969d85445cc to your computer and use it in GitHub Desktop.
# rule 0
def rule0(text, index):
doc = nlp(text)
token = doc[index]
entity = ''
for sub_tok in token.children:
if (sub_tok.dep_ in ['compound','amod']):
entity += sub_tok.text+' '
entity += token.text
return entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment