Adding Answer Extraction and Selection Techniques

The answer extraction and selection stage in Ephyra's pipeline is organized as an ordered list of filter components. A filter manipulates a set of results. Common operations are (1) to generate new results from existing ones (e.g. by extracting factoid answers from sentences); (2) to drop poor results; and (3) to adjust the confidence scores of results. A new answer extraction or selection technique can be integrated by adding one of these filters:

  • Extend the class info.ephyra.answerselection.filters.Filter. We recommend to append the suffix Filter to the class name and to add your new class to the package info.ephyra.answerselection.filters.
  • Implement the method apply(Result) if you want to manipulate the results independently (e.g. drop stopwords), or the method apply(Result[]) if you want to process multiple results at once (e.g. sort the results by their confidence scores). Refer to existing filters for examples.
  • Finally, you need to add your filter to one of the init-methods in the main class that you are running. For instance, let us assume that you have developed a new answer extraction technique for factoid questions, and that you have named your filter MyExtractionFilter. Then you would add the following line to the answer extraction and selection part of the initFactoid() method in your main class:
    AnswerSelection.addFilter(new MyExtractionFilter());
    Note that the order is important here! For instance, you may want to extract factoid answers first and then filter out stopwords.

Comments about this tutorial? Please email Nico Schlaefer.