public class SenseManager extends Object
Modifier and Type | Field and Description |
---|---|
SenseExampleGenerator |
exampleGenerator |
boolean |
trainingMode
A flag that indicates that the manager is in training mode, which prompts extensive caching.
|
Constructor and Description |
---|
SenseManager(boolean trainingMode) |
Modifier and Type | Method and Description |
---|---|
static String |
getGoldViewName() |
ILPInference |
getInference(ILPSolverFactory solver,
List<Constituent> predicates) |
protected HashMap<String,Integer> |
getLabelIdMap(String[] strings) |
Set<String> |
getLegalSenses(String predicate)
Get the set of valid senses for this predicate using the frame files.
|
String |
getLexiconFileName()
The name of the file that contains the lexicon
|
String |
getModelFileName()
The name of the file that contains the model for the given model type
|
ModelInfo |
getModelInfo() |
int |
getNumLabels() |
int |
getNumSenses() |
PredicateDetector |
getPredicateDetector() |
static String |
getPredictedViewName() |
int |
getPruneSize() |
double[] |
getScores(SenseInstance x,
boolean rescoreInvalidLabels)
Scores instance for the different labels allowed for it
|
String |
getSense(int id) |
int |
getSenseId(String label) |
protected String[] |
getSenseLabels() |
boolean |
isValidLabel(SenseInstance x,
int label)
Checks if the input label is a valid label Id of the specified model type for the input x.
|
boolean |
isValidSense(String predicate,
int senseId)
Checks if the given sense id is a valid predicate sense for the given predicate.
|
public final boolean trainingMode
public final SenseExampleGenerator exampleGenerator
public int getNumLabels()
public int getSenseId(String label)
protected String[] getSenseLabels()
public int getNumSenses()
public String getSense(int id)
public PredicateDetector getPredicateDetector()
public int getPruneSize()
public ModelInfo getModelInfo()
public static String getGoldViewName()
public static String getPredictedViewName()
public String getLexiconFileName()
public String getModelFileName()
public boolean isValidSense(String predicate, int senseId)
public boolean isValidLabel(SenseInstance x, int label)
public Set<String> getLegalSenses(String predicate)
public double[] getScores(SenseInstance x, boolean rescoreInvalidLabels)
public ILPInference getInference(ILPSolverFactory solver, List<Constituent> predicates) throws Exception
Exception
Copyright © 2017. All rights reserved.