Created
June 5, 2020 21:44
-
-
Save aniruddha27/07e760dd5b53cef35b52652bafa5f687 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
def rule2_mod(text,index): | |
doc = nlp(text) | |
phrase = '' | |
for token in doc: | |
if token.i == index: | |
for subtoken in token.children: | |
if (subtoken.pos_ == 'ADJ'): | |
phrase += ' '+subtoken.text | |
break | |
return phrase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment