opennlp.tools.coref
Class DefaultLinker

java.lang.Object
  extended by opennlp.tools.coref.AbstractLinker
      extended by opennlp.tools.coref.DefaultLinker
All Implemented Interfaces:
Linker
Direct Known Subclasses:
TreebankLinker

public class DefaultLinker
extends AbstractLinker

This class perform coreference for treebank style parses or for noun-phrase chunked data. Non-constituent entities such as pre-nominal named-entities and sub entities in simple coordinated noun phases will be created. This linker requires that named-entity information also be provided. This information can be added to the parse using the -parse option with EnglishNameFinder.


Field Summary
protected  MaxentCompatibilityModel mcm
           
 
Fields inherited from class opennlp.tools.coref.AbstractLinker
corefProject, debug, entities, headFinder, linker, mentionFinder, mode, removeUnresolvedMentions, resolverNames, resolvers, SINGULAR_PRONOUN, useDiscourseModel
 
Fields inherited from interface opennlp.tools.coref.Linker
COMBINED_NPS, DESCRIPTOR, ISA, NP, PRONOUN_MODIFIER, PROPER_NOUN_MODIFIER
 
Constructor Summary
DefaultLinker(String modelDirectory, LinkerMode mode)
          Creates a new linker with the specified model directory, running in the specified mode.
DefaultLinker(String modelDirectory, LinkerMode mode, boolean useDiscourseModel)
          Creates a new linker with the specified model directory, running in the specified mode which uses a discourse model based on the specified parameter.
DefaultLinker(String modelDirectory, LinkerMode mode, boolean useDiscourseModel, double fixedNonReferentialProbability)
          Creates a new linker with the specified model directory, running in the specified mode which uses a discourse model based on the specified parameter and uses the specified fixed non-referential probability.
 
Method Summary
protected  Gender computeGender(MentionContext mention)
           
protected  Number computeNumber(MentionContext mention)
           
protected  void initHeadFinder()
          Initializes the head finder for this linker.
protected  void initMentionFinder()
          Initializes the mention finder for this linker.
protected  void initResolvers(LinkerMode mode, double fixedNonReferentialProbability)
          Initializes the resolvers used by this linker.
 
Methods inherited from class opennlp.tools.coref.AbstractLinker
checkForMerges, constructMentionContexts, getEntities, getHeadFinder, getMentionFinder, resolve, setEntities, train, updateExtent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mcm

protected MaxentCompatibilityModel mcm
Constructor Detail

DefaultLinker

public DefaultLinker(String modelDirectory,
                     LinkerMode mode)
              throws IOException
Creates a new linker with the specified model directory, running in the specified mode.

Parameters:
modelDirectory - The directory where the models for this linker are kept.
mode - The mode that this linker is running in.
Throws:
IOException - when the models can not be read or written to based on the mode.

DefaultLinker

public DefaultLinker(String modelDirectory,
                     LinkerMode mode,
                     boolean useDiscourseModel)
              throws IOException
Creates a new linker with the specified model directory, running in the specified mode which uses a discourse model based on the specified parameter.

Parameters:
modelDirectory - The directory where the models for this linker are kept.
mode - The mode that this linker is running in.
useDiscourseModel - Whether the model should use a discourse model or not.
Throws:
IOException - when the models can not be read or written to based on the mode.

DefaultLinker

public DefaultLinker(String modelDirectory,
                     LinkerMode mode,
                     boolean useDiscourseModel,
                     double fixedNonReferentialProbability)
              throws IOException
Creates a new linker with the specified model directory, running in the specified mode which uses a discourse model based on the specified parameter and uses the specified fixed non-referential probability.

Parameters:
modelDirectory - The directory where the models for this linker are kept.
mode - The mode that this linker is running in.
useDiscourseModel - Whether the model should use a discourse model or not.
fixedNonReferentialProbability - The probability which resolvers are required to exceed to positi a coreference relationship.
Throws:
IOException - when the models can not be read or written to based on the mode.
Method Detail

initResolvers

protected void initResolvers(LinkerMode mode,
                             double fixedNonReferentialProbability)
                      throws IOException
Initializes the resolvers used by this linker.

Parameters:
mode - The mode in which this linker is being used.
fixedNonReferentialProbability -
Throws:
IOException

initHeadFinder

protected void initHeadFinder()
Initializes the head finder for this linker.


initMentionFinder

protected void initMentionFinder()
Initializes the mention finder for this linker. This can be over-ridden to change the space of mentions used for coreference.


computeGender

protected Gender computeGender(MentionContext mention)
Specified by:
computeGender in class AbstractLinker

computeNumber

protected Number computeNumber(MentionContext mention)
Specified by:
computeNumber in class AbstractLinker


Copyright © 2010. All Rights Reserved.