architxt.nlp.parser.corenlp

architxt.nlp.parser.corenlp#

Classes

CoreNLPParser(*, corenlp_url)

class architxt.nlp.parser.corenlp.CoreNLPParser(*, corenlp_url)[source]#

Bases: Parser

raw_parse(sentences, *, language, batch_size=128)[source]#

Parse a sentences into syntax trees using CoreNLP server.

Parameters:
  • sentences (Iterable[str]) – The sentences to parse.

  • language (str) – The language to use for parsing.

  • batch_size (int) – The maximum number of concurrent parsing tasks that can run at once.

Return type:

Iterator[Tree]

Returns:

The parse trees of the sentences.

Example:
with Parser(corenlp_url="http://localhost:9000") as parser:
    for tree in parser.raw_parse(sentences, language='English'):
        print(tree)