Created
January 5, 2021 08:04
-
-
Save RiansyahTohamba/ddd794412ed9ed36eb467442bf584e9b 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
# chunk by np-chunk | |
def get_chunk_np(sentence): | |
grammar = "NP: {<DT>?<JJ>*<NN>}" | |
cp = nltk.RegexpParser(grammar) | |
result = cp.parse(sentence) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment