除了 Keras 和 Spacy,我可以使用 Stanford Core NLP 进行深度学习吗?
Apart from Keras and Spacy, can I use Stanford Core NLP for Deep Learning?
我正在尝试使用深度学习 (RNN) 对 Twitter 数据执行情绪分析。我知道还有其他各种深度学习库,如 TF、keras、gensim 等,但我想知道是否可以使用 CoreNLP 库执行深度学习。
https://github.com/charlescc9/deep-learning-sentiment-analysis
上面这个人试图比较深度学习的gensim、tensorflow和core nlp。但是几乎没有任何文档,我无法理解如何 运行 文件(或)所需的依赖项。请帮帮我。
我之前出于同样的原因使用过 RNN,这是我所做的:
准备就绪
- 下载 coreNLP 包。您可以从 here.
开始
- 通过 运行ning
pip install pycorenlp
安装 pycorenlp wrapper。
- 安装
Java>=1.8
如果没有安装。
用法
现在,让我们看看如何使用它:
- 将下载的 zip 文件解压到您的项目目录中
- 打开终端并运行以下内容:
java -mx5g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -timeout 10000
- 现在,服务器默认 运行 宁
localhost:9000
。现在,您可以编写程序了。
这是一个简单的例子:
>>> from pycorenlp import StanfordCoreNLP
>>>
>>> sentence = "NLP is great"
>>> nlp = StanfordCoreNLP('http://localhost:9000')
>>> res = nlp.annotate(sentence, properties={ 'annotators': 'sentiment',
... 'outputFormat': 'json',
... 'timeout': 10000,})
>>> #you can get the class by:
>>> klass = res["sentences"][0]["sentimentValue"]
我正在尝试使用深度学习 (RNN) 对 Twitter 数据执行情绪分析。我知道还有其他各种深度学习库,如 TF、keras、gensim 等,但我想知道是否可以使用 CoreNLP 库执行深度学习。
https://github.com/charlescc9/deep-learning-sentiment-analysis
上面这个人试图比较深度学习的gensim、tensorflow和core nlp。但是几乎没有任何文档,我无法理解如何 运行 文件(或)所需的依赖项。请帮帮我。
我之前出于同样的原因使用过 RNN,这是我所做的:
准备就绪
- 下载 coreNLP 包。您可以从 here. 开始
- 通过 运行ning
pip install pycorenlp
安装 pycorenlp wrapper。 - 安装
Java>=1.8
如果没有安装。
用法
现在,让我们看看如何使用它:
- 将下载的 zip 文件解压到您的项目目录中
- 打开终端并运行以下内容:
java -mx5g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -timeout 10000
- 现在,服务器默认 运行 宁
localhost:9000
。现在,您可以编写程序了。
这是一个简单的例子:
>>> from pycorenlp import StanfordCoreNLP
>>>
>>> sentence = "NLP is great"
>>> nlp = StanfordCoreNLP('http://localhost:9000')
>>> res = nlp.annotate(sentence, properties={ 'annotators': 'sentiment',
... 'outputFormat': 'json',
... 'timeout': 10000,})
>>> #you can get the class by:
>>> klass = res["sentences"][0]["sentimentValue"]