info.ephyra
Class OpenEphyra

java.lang.Object
  extended by info.ephyra.OpenEphyra
Direct Known Subclasses:
OpenEphyraCorpus

public class OpenEphyra
extends java.lang.Object

OpenEphyra is an open framework for question answering (QA).

Version:
2008-01-26
Author:
Nico Schlaefer

Field Summary
protected  java.lang.String dir
          The directory of Ephyra, required when Ephyra is used as an API.
protected static float FACTOID_ABS_THRESH
          Absolute threshold for factoid question scores.
protected static int FACTOID_MAX_ANSWERS
          Maximum number of factoid answers.
protected static float LIST_REL_THRESH
          Relative threshold for list question scores (fraction of top score).
static java.lang.String NORMALIZER
          Serialized classifier for score normalization.
 
Constructor Summary
protected OpenEphyra()
          Creates a new instance of Ephyra and initializes the system.
  OpenEphyra(java.lang.String dir)
          Creates a new instance of Ephyra and initializes the system.
 
Method Summary
 Result askFactoid(java.lang.String question)
          Asks Ephyra a factoid question and returns a single result or null if no answer could be found.
 Result[] askFactoid(java.lang.String question, int maxAnswers, float absThresh)
          Asks Ephyra a factoid question and returns up to maxAnswers results that have a score of at least absThresh.
 Result[] askList(java.lang.String question, float relThresh)
          Asks Ephyra a list question and returns results that have a score of at least relThresh * top score.
 void commandLine()
          A command line interface for Ephyra.
 java.lang.String getDir()
          Returns the directory of the Ephyra engine.
protected  void initFactoid()
          Initializes the pipeline for factoid questions.
static void main(java.lang.String[] args)
          Entry point of Ephyra.
protected  java.lang.String readLine()
          Reads a line from the command prompt.
protected  Result[] runPipeline(AnalyzedQuestion aq, int maxAnswers, float absThresh)
          Runs the pipeline on a factoid question and returns an array of up to maxAnswers results that have a score of at least absThresh.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTOID_MAX_ANSWERS

protected static final int FACTOID_MAX_ANSWERS
Maximum number of factoid answers.

See Also:
Constant Field Values

FACTOID_ABS_THRESH

protected static final float FACTOID_ABS_THRESH
Absolute threshold for factoid question scores.

See Also:
Constant Field Values

LIST_REL_THRESH

protected static final float LIST_REL_THRESH
Relative threshold for list question scores (fraction of top score).

See Also:
Constant Field Values

NORMALIZER

public static final java.lang.String NORMALIZER
Serialized classifier for score normalization.

See Also:
Constant Field Values

dir

protected java.lang.String dir
The directory of Ephyra, required when Ephyra is used as an API.

Constructor Detail

OpenEphyra

protected OpenEphyra()

Creates a new instance of Ephyra and initializes the system.

For use as a standalone system.


OpenEphyra

public OpenEphyra(java.lang.String dir)

Creates a new instance of Ephyra and initializes the system.

For use as an API.

Parameters:
dir - directory of Ephyra
Method Detail

main

public static void main(java.lang.String[] args)
Entry point of Ephyra. Initializes the engine and starts the command line interface.

Parameters:
args - command line arguments are ignored

readLine

protected java.lang.String readLine()
Reads a line from the command prompt.

Returns:
user input

initFactoid

protected void initFactoid()
Initializes the pipeline for factoid questions.


runPipeline

protected Result[] runPipeline(AnalyzedQuestion aq,
                               int maxAnswers,
                               float absThresh)
Runs the pipeline on a factoid question and returns an array of up to maxAnswers results that have a score of at least absThresh.

Parameters:
aq - analyzed question
maxAnswers - maximum number of answers
absThresh - absolute threshold for scores
Returns:
array of results

getDir

public java.lang.String getDir()
Returns the directory of the Ephyra engine.

Returns:
directory

commandLine

public void commandLine()

A command line interface for Ephyra.

Repeatedly queries the user for a question, asks the system the question and prints out and logs the results.

The command exit can be used to quit the program.


askFactoid

public Result[] askFactoid(java.lang.String question,
                           int maxAnswers,
                           float absThresh)
Asks Ephyra a factoid question and returns up to maxAnswers results that have a score of at least absThresh.

Parameters:
question - factoid question
maxAnswers - maximum number of answers
absThresh - absolute threshold for scores
Returns:
array of results

askFactoid

public Result askFactoid(java.lang.String question)
Asks Ephyra a factoid question and returns a single result or null if no answer could be found.

Parameters:
question - factoid question
Returns:
single result or null

askList

public Result[] askList(java.lang.String question,
                        float relThresh)
Asks Ephyra a list question and returns results that have a score of at least relThresh * top score.

Parameters:
question - list question
relThresh - relative threshold for scores
Returns:
array of results