Stanford nlp for python

前端 未结 9 1244
野的像风
野的像风 2020-11-29 17:41

All I want to do is find the sentiment (positive/negative/neutral) of any given string. On researching I came across Stanford NLP. But sadly its in Java. Any ideas on how ca

9条回答
  •  情话喂你
    2020-11-29 18:14

    There is a very new progress on this issue:

    Now you can use stanfordnlp package inside the python:

    From the README:

    >>> import stanfordnlp
    >>> stanfordnlp.download('en')   # This downloads the English models for the neural pipeline
    >>> nlp = stanfordnlp.Pipeline() # This sets up a default neural pipeline in English
    >>> doc = nlp("Barack Obama was born in Hawaii.  He was elected president in 2008.")
    >>> doc.sentences[0].print_dependencies()
    

提交回复
热议问题