nltk.ProbabilisticNonprojectiveParser.parse

ProbabilisticNonprojectiveParser.parse(tokens, tags)[source]

Parses a list of tokens in accordance to the MST parsing algorithm for non-projective dependency parses. Assumes that the tokens to be parsed have already been tagged and those tags are provided. Various scoring methods can be used by implementing the DependencyScorerI interface and passing it to the training algorithm.

Parameters:
  • tokens (list(str)) – A list of words or punctuation to be parsed.
  • tags (list(str)) – A list of tags corresponding by index to the words in the tokens list.
Returns:

An iterator of non-projective parses.

Return type:

iter(DependencyGraph)