info.ephyra.io
Class Logger

java.lang.Object
  extended by info.ephyra.io.Logger

public class Logger
extends java.lang.Object

Logs all questions that are posed to the system and the answers that are returned to a file. Logging can be enabled or disabled. By default, logging is enabled.

Version:
2005-09-30
Author:
Nico Schlaefer

Field Summary
private static boolean enabled
          True, iff logging is enabled.
private static java.io.File logfile
          The log file.
 
Constructor Summary
Logger()
           
 
Method Summary
static void enableLogging(boolean enable)
          Enables or disables logging.
static boolean logAnswerTypes(java.lang.String[] ats)
          Logs the determined answer types.
static boolean logFactoidEnd()
          Ends an entry for a factoid question.
static boolean logFactoidScore(float score, float absThresh)
          Logs the score of the factoid component.
static boolean logFactoidStart(java.lang.String question)
          Starts an entry for a factoid question.
static boolean logInterpretations(QuestionInterpretation[] qis)
          Logs the interpretations of a question.
static boolean logListEnd()
          Ends an entry for a list question.
static boolean logListScore(float score, float relThresh)
          Logs the score of the list component.
static boolean logListStart(java.lang.String question)
          Starts an entry for a list question.
static boolean logNormalization(java.lang.String qn)
          Logs the normalization of a question.
static boolean logOtherEnd()
          Ends an entry for an "Other" question.
static boolean logOtherStart(java.lang.String question)
          Starts an entry for an "Other" question.
static boolean logPredicates(Predicate[] ps)
          Logs the predicates in a question.
static boolean logQueryStrings(Query[] queries)
          Logs the query strings.
static boolean logResults(Result[] results)
          Logs the results returned by the QA engine.
static boolean logResultsJudged(Result[] results, boolean[] correct)
          Logs results with true/false judgements.
static boolean logScores(float precision, float mrr)
          Logs the resulting precision and MRR.
static void setLogfile(java.lang.String filename)
          Sets the log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logfile

private static java.io.File logfile
The log file.


enabled

private static boolean enabled
True, iff logging is enabled.

Constructor Detail

Logger

public Logger()
Method Detail

setLogfile

public static void setLogfile(java.lang.String filename)
Sets the log file.

Parameters:
filename - name of the log file

enableLogging

public static void enableLogging(boolean enable)
Enables or disables logging.

Parameters:
enable - true to enable logging, false to disable it

logFactoidStart

public static boolean logFactoidStart(java.lang.String question)
Starts an entry for a factoid question.

Parameters:
question - question string
Returns:
true, iff logging was successful

logFactoidEnd

public static boolean logFactoidEnd()
Ends an entry for a factoid question.

Returns:
true, iff logging was successful

logListStart

public static boolean logListStart(java.lang.String question)
Starts an entry for a list question.

Parameters:
question - question string
Returns:
true, iff logging was successful

logListEnd

public static boolean logListEnd()
Ends an entry for a list question.

Returns:
true, iff logging was successful

logOtherStart

public static boolean logOtherStart(java.lang.String question)
Starts an entry for an "Other" question.

Parameters:
question - question string
Returns:
true, iff logging was successful

logOtherEnd

public static boolean logOtherEnd()
Ends an entry for an "Other" question.

Returns:
true, iff logging was successful

logNormalization

public static boolean logNormalization(java.lang.String qn)
Logs the normalization of a question.

Parameters:
qn - question normalization
Returns:
true, iff logging was successful

logAnswerTypes

public static boolean logAnswerTypes(java.lang.String[] ats)
Logs the determined answer types.

Parameters:
ats - answer types
Returns:
true, iff logging was successful

logInterpretations

public static boolean logInterpretations(QuestionInterpretation[] qis)
Logs the interpretations of a question.

Parameters:
qis - question interpretations
Returns:
true, iff logging was successful

logPredicates

public static boolean logPredicates(Predicate[] ps)
Logs the predicates in a question.

Parameters:
ps - predicates
Returns:
true, iff logging was successful

logQueryStrings

public static boolean logQueryStrings(Query[] queries)
Logs the query strings.

Parameters:
queries - the queries
Returns:
true, iff logging was successful

logResults

public static boolean logResults(Result[] results)
Logs the results returned by the QA engine.

Parameters:
results - the results
Returns:
true, iff logging was successful

logResultsJudged

public static boolean logResultsJudged(Result[] results,
                                       boolean[] correct)
Logs results with true/false judgements.

Parameters:
results - the results
correct - judgements
Returns:
true, iff logging was successful

logScores

public static boolean logScores(float precision,
                                float mrr)
Logs the resulting precision and MRR.

Parameters:
precision - the precision
mrr - mean reciprocal rank
Returns:
true, iff logging was successful

logFactoidScore

public static boolean logFactoidScore(float score,
                                      float absThresh)
Logs the score of the factoid component.

Parameters:
score - the score
absThresh - absolute confidence threshold for results

logListScore

public static boolean logListScore(float score,
                                   float relThresh)
Logs the score of the list component.

Parameters:
score - the score
relThresh - relative confidence threshold for results