斯坦福大学CoreNLP非常慢 [英] Stanford CoreNLP very slow

查看:871
本文介绍了斯坦福大学CoreNLP非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Windows 中执行NLP项目,问题是每当我从命令提示符运行Stanford CoreNLP时,生成给定输入文本文件的XML输出大约需要14-15秒.我认为此问题是因为加载库需要花费大量时间.请问有人能说明问题是什么,如何解决这个问题,因为这次问题对我的项目来说是一个大问题?

I am doing a NLP project in Windows and the problem is whenever I run Stanford CoreNLP from my command prompt, it takes about 14-15 seconds to generate the XML output of the given input text file. I think that this issue is because the library takes quite a lot of time to load. Can please somebody explain what the problem is and how can I resolve this issue as this time problem is a big issue for my project?

推荐答案

斯坦福大学CoreNLP使用各种参数的大型模型文件.是的,它们需要很多时间来加载.您要做的就是只启动一次程序,然后再输入很多文本.

Stanford CoreNLP uses large model files of parameters for various components. Yes, they take lots of time to load. What you want to do is to only start up the program once and then to feed it lots of text.

您的操作方式取决于您在做什么:

How you do that depends what you are doing:

  • 您可以将-filelist传递给命令行版本,以一次处理一大堆文件.
  • 您可以让一个StanfordCoreNLP对象保持运行状态,并向其发送文件,然后使用API​​返回输出.
  • 根据所需的NLP处理方式,您可能还可以通过不加载不使用的模型来加快启动速度.请参阅注释者"属性.

更新2016年:现在,文档页面 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆