|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.questionanalysis.atype.QuestionClassifier
public abstract class QuestionClassifier
A class for classifying questions in terms of their expected answer type.
This abstract class contains most of the accessor methods for getting a
question's classification results, while the details of exactly how that
classification is determined (see the
classify
method) is left to the subclasses.
| Field Summary | |
|---|---|
protected FeatureExtractor |
extractor
|
protected boolean |
isInitialized
|
protected edu.cmu.lti.util.Pair<edu.cmu.lti.javelin.util.Language,edu.cmu.lti.javelin.util.Language> |
languagePair
|
private static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
QuestionClassifier()
|
|
| Method Summary | |
|---|---|
abstract java.util.List<AnswerType> |
classify(edu.cmu.minorthird.classify.Instance instance)
Classifies a question, represented by an Instance, in terms of its expected answer type. |
void |
classifySet(java.lang.String filename)
|
void |
evaluate(java.lang.String testSetFileName)
Evaluates classification accuracy on a given test set. |
java.util.List<AnswerType> |
getAnswerTypes(java.util.List<edu.cmu.lti.javelin.qa.Term> terms,
java.lang.String parseTreeStr)
Classifies the question represented by the given List of Terms and parse tree as having a particular answer type and possibly subtype. |
java.util.List<AnswerType> |
getAnswerTypes(java.lang.String question)
Classifies the question represented by the given String as having a particular answer type and possibly subtype. |
java.util.List<AnswerType> |
getAnswerTypes(java.lang.String question,
java.lang.String parseTreeStr)
Classifies the question represented by the given String and parse tree as having a particular answer type and possibly subtype. |
edu.cmu.lti.util.Pair<edu.cmu.lti.javelin.util.Language,edu.cmu.lti.javelin.util.Language> |
getLanguagePair()
|
void |
initialize()
Initializes the FeatureExtractor. |
boolean |
isInitialized()
|
void |
setInitialized(boolean isInitialized)
|
void |
setLanguagePair(edu.cmu.lti.util.Pair<edu.cmu.lti.javelin.util.Language,edu.cmu.lti.javelin.util.Language> languagePair)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.apache.log4j.Logger log
protected FeatureExtractor extractor
protected boolean isInitialized
protected edu.cmu.lti.util.Pair<edu.cmu.lti.javelin.util.Language,edu.cmu.lti.javelin.util.Language> languagePair
| Constructor Detail |
|---|
public QuestionClassifier()
| Method Detail |
|---|
public void initialize()
throws java.lang.Exception
java.lang.Exception - if one of the required input properties is not definedpublic boolean isInitialized()
public void setInitialized(boolean isInitialized)
isInitialized - the isInitialized to setpublic void setLanguagePair(edu.cmu.lti.util.Pair<edu.cmu.lti.javelin.util.Language,edu.cmu.lti.javelin.util.Language> languagePair)
languagePair - the languagePair to setpublic edu.cmu.lti.util.Pair<edu.cmu.lti.javelin.util.Language,edu.cmu.lti.javelin.util.Language> getLanguagePair()
public java.util.List<AnswerType> getAnswerTypes(java.util.List<edu.cmu.lti.javelin.qa.Term> terms,
java.lang.String parseTreeStr)
throws java.lang.Exception
terms - the Terms that make up the question to classifyparseTreeStr - the syntactic parse tree of the question, in String format
java.lang.Exception
public java.util.List<AnswerType> getAnswerTypes(java.lang.String question,
java.lang.String parseTreeStr)
throws java.lang.Exception
question - the question to classifyparseTreeStr - the syntactic parse tree of the question, in String format
java.lang.Exception
public java.util.List<AnswerType> getAnswerTypes(java.lang.String question)
throws java.lang.Exception
question - the question to classify
java.lang.Exceptionpublic abstract java.util.List<AnswerType> classify(edu.cmu.minorthird.classify.Instance instance)
instance - the Instance to be classified.
public void evaluate(java.lang.String testSetFileName)
throws java.lang.Exception
testSetFileName - the name of the file containing the test set to evaluate against
java.lang.Exceptionpublic void classifySet(java.lang.String filename)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||