architxt.nlp.parser.benepar

architxt.nlp.parser.benepar#

Classes

BeneparParser(*, spacy_models[, benepar_models])

class architxt.nlp.parser.benepar.BeneparParser(*, spacy_models, benepar_models=None)[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)