|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object opennlp.tools.coref.resolver.AbstractResolver opennlp.tools.coref.resolver.MaxentResolver
public abstract class MaxentResolver
Provides common functionality used by classes which implement the Resolver
class and use maximum entropy models to make resolution decisions.
Field Summary | |
---|---|
static String |
DEFAULT
Default feature value. |
static String |
DIFF
Outcome when two mentions are not coreferent. |
protected NonReferentialResolver |
nonReferentialResolver
The model for computing non-referential probabilities. |
protected boolean |
pairedSampleSelection
When true, this designates that training should consist of a single positive and a single negative example (when possible) for each mention. |
protected boolean |
preferFirstReferent
When true, this designates that the resolver should use the first referent encountered which it more preferable than non-reference. |
static String |
SAME
Outcomes when two mentions are coreferent. |
protected boolean |
useSameModelForNonRef
When true, this designates that the same maximum entropy model should be used non-reference events (the pairing of a mention and the "null" reference) as is used for potentially referential pairs. |
Fields inherited from class opennlp.tools.coref.resolver.AbstractResolver |
---|
distances, numEntitiesBack, numSentencesBack, showExclusions |
Constructor Summary | |
---|---|
protected |
MaxentResolver(int numberOfEntitiesBack,
boolean preferFirstReferent)
Creates a maximum-entropy-based resolver which will look the specified number of entities back for a referent. |
|
MaxentResolver(String modelDirectory,
String modelName,
ResolverMode mode,
int numberEntitiesBack)
Creates a maximum-entropy-based resolver with the specified model name, using the specified mode, which will look the specified number of entities back for a referent. |
|
MaxentResolver(String modelDirectory,
String modelName,
ResolverMode mode,
int numberEntitiesBack,
boolean preferFirstReferent)
|
|
MaxentResolver(String modelDirectory,
String modelName,
ResolverMode mode,
int numberEntitiesBack,
boolean preferFirstReferent,
double nonReferentialProbability)
|
|
MaxentResolver(String modelDirectory,
String name,
ResolverMode mode,
int numberOfEntitiesBack,
boolean preferFirstReferent,
NonReferentialResolver nonReferentialResolver)
Creates a maximum-entropy-based resolver with the specified model name, using the specified mode, which will look the specified number of entities back for a referent and prefer the first referent if specified. |
|
MaxentResolver(String modelDirectory,
String modelName,
ResolverMode mode,
int numberEntitiesBack,
NonReferentialResolver nonReferentialResolver)
|
Method Summary | |
---|---|
protected boolean |
defaultReferent(DiscourseEntity de)
Returns whether the specified entity satisfies the criteria for being a default referent. |
protected boolean |
excluded(MentionContext ec,
DiscourseEntity de)
Excludes entities which you are not compatible with the entity under consideration. |
protected List<String> |
getFeatures(MentionContext mention,
DiscourseEntity entity)
Returns a list of features for deciding whether the specified mention refers to the specified discourse entity. |
DiscourseEntity |
resolve(MentionContext ec,
DiscourseModel dm)
Resolve this referring expression to a discourse entity in the discourse model. |
DiscourseEntity |
retain(MentionContext mention,
DiscourseModel dm)
Uses the specified mention and discourse model to train this resolver. |
static void |
setSimilarityModel(TestSimilarityModel sm)
|
void |
train()
Retrains model on examples for which retain was called. |
Methods inherited from class opennlp.tools.coref.resolver.AbstractResolver |
---|
featureString, getHead, getHeadIndex, getHeadString, getNumEntities, getNumEntities, outOfRange, setNumberSentencesBack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface opennlp.tools.coref.resolver.Resolver |
---|
canResolve |
Field Detail |
---|
public static final String SAME
public static final String DIFF
public static final String DEFAULT
protected boolean preferFirstReferent
protected boolean pairedSampleSelection
protected boolean useSameModelForNonRef
protected NonReferentialResolver nonReferentialResolver
Constructor Detail |
---|
protected MaxentResolver(int numberOfEntitiesBack, boolean preferFirstReferent)
numberOfEntitiesBack
- preferFirstReferent
- public MaxentResolver(String modelDirectory, String name, ResolverMode mode, int numberOfEntitiesBack, boolean preferFirstReferent, NonReferentialResolver nonReferentialResolver) throws IOException
modelDirectory
- The name of the directory where the resolver models are stored.name
- The name of the file where this model will be read or written.mode
- The mode this resolver is being using in (training, testing).numberOfEntitiesBack
- The number of entities back in the text that this resolver will look
for a referent.preferFirstReferent
- Set to true if the resolver should prefer the first referent which is more
likely than non-reference. This only affects testing.nonReferentialResolver
- Determines how likely it is that this entity is non-referential.
IOException
- If the model file is not found or can not be written to.public MaxentResolver(String modelDirectory, String modelName, ResolverMode mode, int numberEntitiesBack) throws IOException
modelDirectory
- The name of the directory where the resover models are stored.modelName
- The name of the file where this model will be read or written.mode
- The mode this resolver is being using in (training, testing).numberEntitiesBack
- The number of entities back in the text that this resolver will look
for a referent.
IOException
- If the model file is not found or can not be written to.public MaxentResolver(String modelDirectory, String modelName, ResolverMode mode, int numberEntitiesBack, NonReferentialResolver nonReferentialResolver) throws IOException
IOException
public MaxentResolver(String modelDirectory, String modelName, ResolverMode mode, int numberEntitiesBack, boolean preferFirstReferent) throws IOException
IOException
public MaxentResolver(String modelDirectory, String modelName, ResolverMode mode, int numberEntitiesBack, boolean preferFirstReferent, double nonReferentialProbability) throws IOException
IOException
Method Detail |
---|
public DiscourseEntity resolve(MentionContext ec, DiscourseModel dm)
Resolver
ec
- the referring expression.dm
- the discourse model.
protected boolean defaultReferent(DiscourseEntity de)
de
- The discourse entity being considered for non-reference.
public DiscourseEntity retain(MentionContext mention, DiscourseModel dm)
Resolver
retain
in interface Resolver
retain
in class AbstractResolver
mention
- The mention which is being used for training.dm
- the discourse model.
protected List<String> getFeatures(MentionContext mention, DiscourseEntity entity)
mention
- the mention being considers as possibly referential.entity
- The discourse entity with which the mention is being considered referential.
public void train() throws IOException
Resolver
train
in interface Resolver
train
in class AbstractResolver
IOException
public static void setSimilarityModel(TestSimilarityModel sm)
protected boolean excluded(MentionContext ec, DiscourseEntity de)
AbstractResolver
excluded
in class AbstractResolver
ec
- The mention which is being considered as referential.de
- The entity to which the mention is to be resolved.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |