Stanford Natural Language Parser
The Stanford Natural Language Parser is installed on the Linguistics cluster. This is a probabilistic PCFG and dependency parser. To see a demo run the following command line:
/NLP_TOOLS/parsers/stanford_parser/latest/lexparser.csh /NLP_TOOLS/parsers/stanford_parser/latest/testsent.txt
For more details, see the Stanford Parser
website.
The cluster also has a
Ruby wrapper for this parser. Sample usage in the Ruby interactive mode:
$ irb
irb(main):001:0> require "stanfordparser"
=> true
irb(main):002:0> parser = StanfordParser::LexicalizedParser.new
Loading parser from serialized file /NLP_TOOLS/parsers/stanford_parser/latest/englishPCFG.ser.gz ... done [2.7 sec].
=> <edu.stanford.nlp.parser.lexparser.LexicalizedParser>
irb(main):003:0> puts parser.apply("This is a sentence.")
(ROOT
(S [24.917]
(NP [6.139] (DT [2.300] This))
(VP [17.636] (VBZ [0.144] is)
(NP [12.299] (DT [1.419] a) (NN [8.897] sentence)))
(. [0.002] .)))
Sample usage with an example script:
$ ruby /opt/ruby-gems/lib/ruby/gems/1.8/gems/stanfordparser-1.1.0/examples/stanford-sentence-parser.rb "This is a sentence."
Loading parser from serialized file /NLP_TOOLS/parsers/stanford_parser/latest/englishPCFG.ser.gz ... done [3.1 sec].
(ROOT
(S [24.917]
(NP [6.139] (DT [2.300] This))
(VP [17.636] (VBZ [0.144] is)
(NP [12.299] (DT [1.419] a) (NN [8.897] sentence)))
(. [0.002] .)))
--
BillMcNeill - 05 Nov 2007
Topic revision: r2 - 2007-11-06 - 17:28:13 -
BillMcNeill