you can use StanfordCoreNLP to achieve that
download :
pip install pycorenlp
start your server in this (stanford-corenlp-full-2018-01-31) directory with this command -
java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer
-port 9000 -timeout 15000
from pycorenlp import StanfordCoreNLP
nlp = StanfordCoreNLP('http://localhost:9000')
output = nlp.annotate(textInput, properties={
'annotators': 'parse',
'outputFormat': 'json',
'timeout': 1000,
})
print(output['sentences'][0]["parse"])
sample input :
Is there any way to associate spotify music with a specific ambient so when I say to Siri Start Beach Ambient
output :
(ROOT
(SQ (VBZ Is)
(NP (EX there))
(NP
(NP (DT any) (NN way))
(S
(VP (TO to)
(VP (VB associate)
(NP (JJ spotify) (NN music))
(PP (IN with)
(NP
(NP (DT a) (JJ specific))
(ADJP (JJ ambient) (RB so)
(SBAR
(WHADVP (WRB when))
(S
(NP (PRP I))
(VP (VBP say)
(PP (TO to)
(NP (NNP Siri) (NNP Start) (NNP Beach) (NNP Ambient)))))))))))))
(. .)))
hope this may help.