|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.questionanalysis.atype.FocusFinder
public class FocusFinder
Finder of the focus word, or target word, of a question.
| Field Summary | |
|---|---|
private static boolean |
isInitialized
|
private static org.apache.log4j.Logger |
log
|
private static java.util.List<edu.cmu.lti.chineseNLP.util.Tree> |
treeTemplates
|
private static java.lang.String |
treeTemplatesFile
|
private static java.lang.String[] |
whLabels
|
| Constructor Summary | |
|---|---|
FocusFinder()
|
|
| Method Summary | |
|---|---|
static edu.cmu.lti.chineseNLP.util.Tree |
findFocusNode(edu.cmu.lti.chineseNLP.util.Tree tree)
Finds the focus, or target, word of a question using the specified tree templates and default rules that look for question words. |
static edu.cmu.lti.javelin.qa.Term |
findFocusTerm(java.util.List<edu.cmu.lti.javelin.qa.Term> terms)
Given a list of Terms, builds a parse tree using Charniak's parser, and then uses the resulting parse tree to find the focus words. |
static edu.cmu.lti.javelin.qa.Term |
findFocusTerm(java.lang.String question)
Given a sentence, builds a parse tree using Charniak's parser, and then uses the resulting parse tree to find the focus words. |
static edu.cmu.lti.javelin.qa.Term |
findFocusTerm(edu.cmu.lti.chineseNLP.util.Tree tree)
Finds the focus word, given a Tree. |
static java.lang.String |
findFocusWord(java.util.List<edu.cmu.lti.javelin.qa.Term> terms)
Given a list of Terms, builds a parse tree using Charniak's parser, and then uses the resulting parse tree to find the focus words. |
static java.lang.String |
findFocusWord(java.lang.String question)
Given a sentence, builds a parse tree using Charniak's parser, and then uses the resulting parse tree to find the focus words. |
static java.lang.String |
findFocusWord(edu.cmu.lti.chineseNLP.util.Tree tree)
Finds the focus word, given a Tree. |
static edu.cmu.lti.chineseNLP.util.Tree |
getHeadWordOrPhrase(edu.cmu.lti.chineseNLP.util.Tree tree)
Extracts the head word or phrase from the given Tree node, which is assumed to be an NP. |
static void |
initialize()
Initializes static resources. |
static boolean |
isInitialized()
|
static void |
main(java.lang.String[] args)
Extracts and prints out the focus word for each question, given a file of questions. |
static void |
setInitialized(boolean isInitialized)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static org.apache.log4j.Logger log
private static boolean isInitialized
private static java.util.List<edu.cmu.lti.chineseNLP.util.Tree> treeTemplates
private static java.lang.String treeTemplatesFile
private static java.lang.String[] whLabels
| Constructor Detail |
|---|
public FocusFinder()
| Method Detail |
|---|
public static void initialize()
throws java.lang.Exception
TreeHelper.extractNode for more details.
java.lang.Exception - if the required input property is not definedpublic static boolean isInitialized()
public static void setInitialized(boolean isInitialized)
isInitialized - the isInitialized to setpublic static edu.cmu.lti.chineseNLP.util.Tree findFocusNode(edu.cmu.lti.chineseNLP.util.Tree tree)
PP if the word
is "kind" or "type"
NN*
or JJ that follows a WDT or WP
NN*
that follows the terminals, "how many".
tree - The syntactic parse tree of the question
null if none was foundpublic static edu.cmu.lti.chineseNLP.util.Tree getHeadWordOrPhrase(edu.cmu.lti.chineseNLP.util.Tree tree)
tree - the Tree node from which to extract the head word or phrasepublic static java.lang.String findFocusWord(edu.cmu.lti.chineseNLP.util.Tree tree)
tree - The syntactic parse tree object
public static java.lang.String findFocusWord(java.util.List<edu.cmu.lti.javelin.qa.Term> terms)
terms - The list of Terms in the question.
public static java.lang.String findFocusWord(java.lang.String question)
question - the input question
public static edu.cmu.lti.javelin.qa.Term findFocusTerm(java.util.List<edu.cmu.lti.javelin.qa.Term> terms)
terms - The list of Terms in the question.
public static edu.cmu.lti.javelin.qa.Term findFocusTerm(java.lang.String question)
question - the input question
public static edu.cmu.lti.javelin.qa.Term findFocusTerm(edu.cmu.lti.chineseNLP.util.Tree tree)
tree - The syntactic parse tree object
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - command-line args: "<propertiesFile> <inputQuestionsFile>"
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||