Klasse Parser

java.lang.Object
opennlp.tools.parser.AbstractBottomUpParser
opennlp.tools.parser.treeinsert.Parser
Alle implementierten Schnittstellen:
Parser

public class Parser extends AbstractBottomUpParser
A built-attach Parser implementation.

Nodes are built when their left-most child is encountered. Subsequent children are attached as daughters. Attachment is based on node in the right-frontier of the tree. After each attachment or building, nodes are assessed as either complete or incomplete. Complete nodes are no longer eligible for daughter attachment.

Complex modifiers which produce additional node levels of the same type are attached with sister-adjunction. Attachment can not take place higher in the right-frontier than an incomplete node.

Siehe auch:
  • Felddetails

    • DONE

      public static final String DONE
      Outcome used when a constituent needs an no additional parent node/building.
      Siehe auch:
    • ATTACH_SISTER

      public static final String ATTACH_SISTER
      Outcome used when a node should be attached as a sister to another node.
      Siehe auch:
    • ATTACH_DAUGHTER

      public static final String ATTACH_DAUGHTER
      Outcome used when a node should be attached as a daughter to another node.
      Siehe auch:
    • NON_ATTACH

      public static final String NON_ATTACH
      Outcome used when a node should not be attached to another node.
      Siehe auch:
    • BUILT

      public static final String BUILT
      Label used to distinguish build nodes from non-built nodes.
      Siehe auch:
  • Konstruktordetails

  • Methodendetails

    • getRightFrontier

      public static List<Parse> getRightFrontier(Parse root, Set<String> punctSet)
      Returns the right frontier of the specified tree with nodes ordered from deepest to shallowest.
      Parameter:
      root - The root of the parse tree.
      punctSet - A set of punctuation symbols to be used.
      Gibt zurück:
      The right frontier of the specified parse tree.
    • train

      public static ParserModel train(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, TrainingParameters mlParams) throws IOException
      Starts a training of a ParserModel.
      Parameter:
      languageCode - An ISO conform language code.
      parseSamples - The samples as input.
      rules - The HeadRules to use.
      mlParams - The parameters for training.
      Gibt zurück:
      A valid ParserModel.
      Löst aus:
      IOException - Thrown if IO errors occurred during training.
    • train

      public static ParserModel train(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, int iterations, int cutoff) throws IOException
      Starts a training of a ParserModel.
      Parameter:
      languageCode - An ISO conform language code.
      parseSamples - The samples as input.
      rules - The HeadRules to use.
      iterations - The number of iterations to be conducted.
      cutoff - The cut-off parameter to be used.
      Gibt zurück:
      A valid ParserModel.
      Löst aus:
      IOException - Thrown if IO errors occurred during training.