Last active
June 28, 2020 18:05
-
-
Save aniruddha27/f870032621ea9c0349a47969d85445cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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