I have the following two strings with their POS tags:
Sent1: \"something like how writer pro or phraseology works would be really cool.\"<
First install the nltk_cli
as per the instructions: https://github.com/alvations/nltk_cli
Then, here's a secret function in nltk_cli
, maybe you'll find it useful:
alvas@ubi:~/git/nltk_cli$ cat infile.txt
something like how writer pro or phraseology works would be really cool .
more options like the syntax editor would be nice
alvas@ubi:~/git/nltk_cli$ python senna.py --chunk2 VP+ADJP infile.txt
would be really cool
would be nice
To illustrate other possible usage:
alvas@ubi:~/git/nltk_cli$ python senna.py --chunk2 VP+VP infile.txt
!!! NO CHUNK of VP+VP in this sentence !!!
!!! NO CHUNK of VP+VP in this sentence !!!
alvas@ubi:~/git/nltk_cli$ python senna.py --chunk2 NP+VP infile.txt
how writer pro or phraseology works would be
the syntax editor would be
alvas@ubi:~/git/nltk_cli$ python senna.py --chunk2 VP+NP infile.txt
!!! NO CHUNK of VP+NP in this sentence !!!
!!! NO CHUNK of VP+NP in this sentence !!!
Then if you want to check if the phrase in sentence and output True/False, simply read and iterate through the outputs from nltk_cli
and check with if-else
conditions.