Coder Social home page Coder Social logo

stanford-parser-in-jython's People

Contributors

vpekar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

stanford-parser-in-jython's Issues

.LexicalizedParser(): expected 8 args; got 1

This looks great, but when I run I get the following:

Traceback (most recent call last):
File "/home/gavin/dev/spyder-workspace/monotonicityMarker/stanfordParserInterface.py", line 317, in
sp = StanfordParser(r'englishPCFG.ser.gz')
File "/home/gavin/dev/spyder-workspace/monotonicityMarker/stanfordParserInterface.py", line 271, in init
self.lp = LexicalizedParser(parser_file)
TypeError: edu.stanford.nlp.parser.lexparser.LexicalizedParser(): expected 8 args; got 1

Any tips are appreciated.

GrammaticalStructure has no getNodes() method

Hi,
the unittests (4/5) throw an error when trying to parse over the nodes of a GrammaticalStructure. Maybe the specification of the EnglishGrammaticalStructure has changed? According to the doc on http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/trees/EnglishGrammaticalStructure.html neither EnglishGrammaticalStructure nor the class it's derived from has this method.
As a quick fix one could use the root() method and parse the tree to return all it's nodes. Is it intendend to be like this?


$ jython -Dpython.path=/Users/Lyssa/Software/stanford-parser-full-2014-08-27/stanford-parser.jar test_stanford.py
Loading parser from serialized file englishPCFG.ser ... done [1.2 sec].
EEEE.
======================================================================
ERROR: test_get_least_common_node (__main__.TestPySentence)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_stanford.py", line 15, in setUp
    self.sentence = PARSER.parse_xml(input)
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 385, in parse_xml
    return PySentence(self, parse, xml_tags)
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 114, in __init__
    self.populate_indices()
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 152, in populate_indices
    for node_i in self.gs.getNodes():
AttributeError: 'edu.stanford.nlp.trees.EnglishGrammaticalStructure' object has no attribute 'getNodes'

======================================================================
ERROR: test_get_most_probable_parses_check_nonzero (__main__.TestStanfordParser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_stanford.py", line 44, in test_get_most_probable_parses_check_nonzero
    parses = [x for x in PARSER.get_most_probable_parses(input, kbest=expected)]
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 344, in get_most_probable_parses
    py_sentence = PySentence(self, candidate_tree.object())
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 114, in __init__
    self.populate_indices()
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 152, in populate_indices
    for node_i in self.gs.getNodes():
AttributeError: 'edu.stanford.nlp.trees.EnglishGrammaticalStructure' object has no attribute 'getNodes'

======================================================================
ERROR: test_get_most_probable_parses_check_types (__main__.TestStanfordParser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_stanford.py", line 34, in test_get_most_probable_parses_check_types
    for s, prob in PARSER.get_most_probable_parses(input, kbest=2):
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 344, in get_most_probable_parses
    py_sentence = PySentence(self, candidate_tree.object())
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 114, in __init__
    self.populate_indices()
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 152, in populate_indices
    for node_i in self.gs.getNodes():
AttributeError: 'edu.stanford.nlp.trees.EnglishGrammaticalStructure' object has no attribute 'getNodes'

======================================================================
ERROR: test_parse_xml (__main__.TestStanfordParser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_stanford.py", line 52, in test_parse_xml
    sentence = PARSER.parse_xml(input)
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 385, in parse_xml
    return PySentence(self, parse, xml_tags)
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 114, in __init__
    self.populate_indices()
  File "/Users/Lyssa/PycharmProjects/graphkernel/stanford.py", line 152, in populate_indices
    for node_i in self.gs.getNodes():
AttributeError: 'edu.stanford.nlp.trees.EnglishGrammaticalStructure' object has no attribute 'getNodes'

----------------------------------------------------------------------
Ran 5 tests in 0.871s

Doesn't work with Stanford 3.5.2

headTagNode seems to have been removed in version 3.5.2 resulting in the error:

'edu.stanford.nlp.trees.TreeGraphNode' object has no attribute 'headTagNode'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.