|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.patternlearning.PatternLearner
public class PatternLearner
A pattern learning tool for Ephyra.
| Field Summary | |
|---|---|
private static java.util.Hashtable<java.lang.String,java.lang.String> |
ass
Maps questions or query strings to answers. |
private static float |
CONFIDENCE_THRESH
Confidence threshold for answer patterns. |
private static java.lang.String[] |
qss
Question strings. |
private static java.util.Hashtable<java.lang.String,java.lang.String> |
regexs
Maps questions or query strings to patterns for correct answers. |
private static float |
SUPPORT_THRESH
Support threshold for answer patterns. |
| Constructor Summary | |
|---|---|
PatternLearner()
|
|
| Method Summary | |
|---|---|
static boolean |
assess()
Loads target-context-answer-regex tuples and answer patterns from resource files, forms queries from the tuples, fetches text passages, assesses the answer patterns on the text passages and writes them to resource files. |
private static void |
assessPatterns(Result[] results)
Assesses the answer patterns on the text passages in the Result objects. |
static boolean |
extract()
Loads target-context-answer-regex tuples from resource files, forms queries, fetches text passages, extracts answer patterns and writes them to resource files. |
private static void |
extractPatterns(Result[] results)
Extracts answer patterns from the text passages in the search results. |
private static Result[] |
fetchPassages(Query[] queries)
Fetches text passages from knowledge sources. |
static boolean |
filter()
Loads answer patterns from resource files, drops patterns with a low support or confidence and writes the remaining patterns back to resource files. |
private static void |
filterPatterns()
Drops answer patterns that have a low support or confidence. |
private static Query[] |
formQueries(java.lang.String dir)
Loads target-context-answer-regex tuples from resource files and forms queries. |
static void |
init()
Initializes the pattern learning tool. |
static boolean |
interpret(java.lang.String qFile,
java.lang.String aFile,
java.lang.String pFile)
Loads the TREC data, interprets the questions and writes target-context-answer-regex tuples to files. |
private static boolean |
interpretQuestions(java.lang.String dir)
Interprets the questions and writes target-context-answer-regex tuples to resource files. |
private static boolean |
loadPatterns(java.lang.String dir)
Loads answer patterns from resource files. |
private static void |
loadTRECData(java.lang.String qFile,
java.lang.String aFile,
java.lang.String pFile)
Loads the questions, answers and patterns from TREC files. |
static void |
main(java.lang.String[] args)
Entry point of the program. |
private static boolean |
saveInterpretation(java.lang.String dir,
QuestionInterpretation qi,
java.lang.String as,
java.lang.String regex)
Saves a question interpretation, an answer string and a regular expression that describes a correct answer to a file. |
private static boolean |
savePatterns(java.lang.String dir)
Saves answer patterns to resource files. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final float SUPPORT_THRESH
private static final float CONFIDENCE_THRESH
private static java.lang.String[] qss
private static java.util.Hashtable<java.lang.String,java.lang.String> ass
private static java.util.Hashtable<java.lang.String,java.lang.String> regexs
| Constructor Detail |
|---|
public PatternLearner()
| Method Detail |
|---|
private static void loadTRECData(java.lang.String qFile,
java.lang.String aFile,
java.lang.String pFile)
qFile - name of the file containing the questionsaFile - name of the file containing the answers or an empty stringpFile - name of the file containing the patterns or an empty stringprivate static boolean interpretQuestions(java.lang.String dir)
dir - target directory
true, iff the interpretations could be written to
resource files
private static boolean saveInterpretation(java.lang.String dir,
QuestionInterpretation qi,
java.lang.String as,
java.lang.String regex)
dir - target directoryqi - question interpretationas - answer stringregex - regular expression
true, iff the tuple could be savedprivate static Query[] formQueries(java.lang.String dir)
dir - directory containing the target-context-answer-regex tuples
private static Result[] fetchPassages(Query[] queries)
queries - the queries sent to the searchers
private static void extractPatterns(Result[] results)
results - search resultsprivate static boolean savePatterns(java.lang.String dir)
dir - target directory
true, iff the answer patterns could be savedprivate static boolean loadPatterns(java.lang.String dir)
dir - directory containing the answer patterns
true, iff the answer patterns could be loadedprivate static void assessPatterns(Result[] results)
Result objects.
results - search resultsprivate static void filterPatterns()
public static void init()
public static boolean interpret(java.lang.String qFile,
java.lang.String aFile,
java.lang.String pFile)
qFile - name of the file containing the questionsaFile - name of the file containing the answers or an empty stringpFile - name of the file containing the patterns or an empty string
true, iff the TREC data could be interpretedpublic static boolean extract()
true, iff the answer patterns could be extractedpublic static boolean assess()
true, iff the answer patterns could be assessedpublic static boolean filter()
true, iff the answer patterns could be filteredpublic static void main(java.lang.String[] args)
Entry point of the program.
Learns and assesses answer patterns using questions and patterns from the TREC QA track as training data.
args - argument 1: name of the question file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||