info.ephyra.answerselection.filters
Class NuggetEvaluationFilter

java.lang.Object
  extended by info.ephyra.answerselection.filters.Filter
      extended by info.ephyra.answerselection.filters.NuggetEvaluationFilter

public class NuggetEvaluationFilter
extends Filter

Automatically evaluates answer candidates for the 'other' questions in TREC 13-16.

This class extends the class Filter.

Version:
2008-02-15
Author:
Guido Sautter

Field Summary
private static java.lang.String baseFileName
           
private  java.lang.String conciseFileName
           
private static java.lang.String DEFAULT_EXPORT_DATE_FORMAT
           
private static java.text.DateFormat EXPORT_DATE_FORMATTER
           
private  java.lang.String fileName
           
private  java.lang.String fileNameMarker
           
private static java.util.HashMap<java.lang.String,NuggetEvaluationFilter> instanceSet
           
private  int[] lastOk
           
private  java.lang.String lastTarget
           
private  int[] lastVital
           
private  java.util.ArrayList<TRECNugget> nuggets
           
private static java.util.HashMap<java.lang.String,java.util.ArrayList<TRECNugget>> nuggetsByTargetID
           
private static int numVital
           
private  java.lang.String targetId
           
private static java.lang.String targetID
           
 
Constructor Summary
NuggetEvaluationFilter()
           
NuggetEvaluationFilter(java.lang.String fileNameMarker)
           
 
Method Summary
 Result apply(Result result)
          This method is not used.
 Result[] apply(Result[] results)
          Extracts NEs of particular types from the answer strings of the Result objects and creates a new Result for each extracted unique answer.
private  java.lang.String[] covers(java.lang.String result, java.lang.String nugget)
          check if some result covers some nugger
 TRECNugget[] getNuggets()
           
private static void loadNuggets()
          load the nuggets from the answer file
private  void setTargetId(java.lang.String tid)
           
static void setTargetID(java.lang.String tid)
          set the ID of the next target, so upcoming results can be checked against the respective nuggets
static void targetFinished()
          gather data from instances and write it to global log file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EXPORT_DATE_FORMAT

private static final java.lang.String DEFAULT_EXPORT_DATE_FORMAT
See Also:
Constant Field Values

EXPORT_DATE_FORMATTER

private static final java.text.DateFormat EXPORT_DATE_FORMATTER

baseFileName

private static final java.lang.String baseFileName

fileNameMarker

private java.lang.String fileNameMarker

fileName

private java.lang.String fileName

conciseFileName

private java.lang.String conciseFileName

lastTarget

private java.lang.String lastTarget

instanceSet

private static java.util.HashMap<java.lang.String,NuggetEvaluationFilter> instanceSet

targetID

private static java.lang.String targetID

targetId

private java.lang.String targetId

nuggets

private java.util.ArrayList<TRECNugget> nuggets

numVital

private static int numVital

lastVital

private int[] lastVital

lastOk

private int[] lastOk

nuggetsByTargetID

private static java.util.HashMap<java.lang.String,java.util.ArrayList<TRECNugget>> nuggetsByTargetID
Constructor Detail

NuggetEvaluationFilter

public NuggetEvaluationFilter()

NuggetEvaluationFilter

public NuggetEvaluationFilter(java.lang.String fileNameMarker)
Method Detail

apply

public Result apply(Result result)
This method is not used. Instead, the method apply(Result[]) from the superclass Filter is overwritten.

Overrides:
apply in class Filter
Parameters:
result - a Result object
Returns:
the same Result object

apply

public Result[] apply(Result[] results)
Extracts NEs of particular types from the answer strings of the Result objects and creates a new Result for each extracted unique answer.

Overrides:
apply in class Filter
Parameters:
results - array of Result objects
Returns:
extended array of Result objects

covers

private java.lang.String[] covers(java.lang.String result,
                                  java.lang.String nugget)
check if some result covers some nugger

Parameters:
result - the result String
nugget - the nugget string
Returns:
the tokens of the specified nugget String not contained in the specified result String

setTargetID

public static void setTargetID(java.lang.String tid)
set the ID of the next target, so upcoming results can be checked against the respective nuggets

Parameters:
tid - the ID of the next target

targetFinished

public static void targetFinished()
gather data from instances and write it to global log file


setTargetId

private void setTargetId(java.lang.String tid)

getNuggets

public TRECNugget[] getNuggets()
Returns:
an array containing the nuggets not covered by results that passed the filter so far

loadNuggets

private static void loadNuggets()
load the nuggets from the answer file