简体   繁体   English

Windows上的Stanford Parser安装失败

[英]Stanford Parser Installation Fails on Windows

Edit: Just let me know what is the "rake setup"? 编辑:请让我知道什么是“耙设置”?

This is my second day of trying to get the stanford parser on windows 7 to work with python. 这是我第二天尝试在Windows 7上让斯坦福解析器与python一起使用。 I stumbled upon this way to install it - using this python interface - http://projects.csail.mit.edu/spatial/Stanford_Parser . 我偶然发现了这种安装方式-使用此python接口-http://projects.csail.mit.edu/spatial/Stanford_Parser

In the installation instructions they require to use rake file setup, but when i using command prompt in windows 7 navigate to the 3rdParty/jpype directory and type in "rake setup" I get an error. 在安装说明中,他们需要使用rake文件设置,但是当我在Windows 7中使用命令提示符时,导航到3rdParty / jpype目录并键入“ rake setup”,我得到一个错误。

We developed a python interface to the Stanford Parser.  It uses JPype
to create a Java virtual machine and convert between python and Java.
Most of the code is about getting the Stanford Dependencies, but it's
easy to add API to call any method on the parser.

JPype is included; you can set compile it by running "rake setup" in
3rdParty/jpype.  The Stanford Parser can be downloaded and installed
by running "rake download; rake setup" in 3rdParty/stanford-parser".
Otherwise set the environment variable STANFORD_PARSER_HOME to the
location of the installed directory.  It loads the grammar file from
the unzipped version, because the load is a few seconds faster.  If
you haven't gunzipped the .ser file you will get an error.

To see how to use it, look at parser_test.py.

Sounds like Rake isn't in your PATH. 听起来Rake不在您的PATH中。

What is Rake? 什么是耙子?

Rake is a build automation tool written using Ruby. Rake是使用Ruby编写的构建自动化工具。 If you've ever used UNIX make , it's similar, except you write your build file in Ruby. 如果您曾经使用过UNIX make ,那么除了使用Ruby编写构建文件外,其他方法都差不多。

If you don't know what make is, just imagine a really fancy batch file that builds a program, except that it only rebuilds what's changed since the last build. 如果您不知道make是什么,那么可以想象一个真正花哨的批处理文件可以构建一个程序,只是它只能重新构建自上次构建以来的更改。

How do I install Rake? 如何安装Rake?

Installing Ruby and RubyGems 安装Ruby和RubyGems

Using RubyInstaller 使用RubyInstaller

Go to http://rubyinstaller.org/downloads/ and download the Ruby 1.9.3 installer. 转到http://rubyinstaller.org/downloads/并下载Ruby 1.9.3安装程序。 Now run it. 现在运行它。 Proceed as any other installer until you reach the screen that lets you choose an installation directory. 与其他任何安装程序一样,直到进入允许您选择安装目录的屏幕。 Here, select the box labeled Add Ruby executables to your PATH . 在此处,选择标记为Add Ruby executables to your PATH的框。 Here's an image: 这是一张图片:


(source: forwardhq.com ) (来源: forwardhq.com

Using Chocolatey 使用巧克力

Download and install Chocolatey by opening a command prompt and running the following long command: 通过打开命令提示符并运行以下长命令来下载并安装Chocolatey:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

Once that's done, run the following command(you may need to restart the command prompt window): 完成后,运行以下命令(您可能需要重新启动命令提示符窗口):

cinst rubygems

Note that these may take a while to even show a sign of moving. 请注意,这些甚至可能需要一段时间才能显示出移动的迹象。

Installing Rake 安装耙

Once Ruby is installed, pop up a command prompt and run: 安装Ruby之后,弹出命令提示符并运行:

gem install rake

Voila! 瞧! Now rake should work correctly. 现在rake应该可以正常工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM