info.ephyra.answerselection.filters
Class PredicateExtractionFilter

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

public class PredicateExtractionFilter
extends Filter

Extracts predicates which are similiar to those in the question from documents.

This class extends the class Filter.

Version:
2007-07-17
Author:
Nico Schlaefer

Field Summary
private static int MAX_SENT_LENGTH_CHARS
          Maximum length of a sentence in characters to be considered for predicate extraction.
private static int MAX_SENT_LENGTH_TOKENS
          Maximum length of a sentence in tokens to be considered for predicate extraction.
private static int MAX_SENTENCES
          Maximum number of sentences that are annotated with predicate-argument structures.
 
Constructor Summary
PredicateExtractionFilter()
           
 
Method Summary
 Result[] apply(Result[] results)
          Extracts relevant predicates from documents.
private  boolean checkSentence(Result sentence)
          Decides if predicates should be extracted from this sentence.
private  java.util.Map<java.lang.String,java.lang.String[]> extractNes(java.lang.String sentence, java.lang.String[] answerTypes)
          Extracts NEs of the expected answer types from a sentence.
private  java.util.Hashtable<java.lang.String[],java.lang.Double> getAllVerbForms(Predicate[] ps)
          Gets all forms of the verbs and expansions of predicates with missing arguments.
 
Methods inherited from class info.ephyra.answerselection.filters.Filter
apply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SENTENCES

private static final int MAX_SENTENCES
Maximum number of sentences that are annotated with predicate-argument structures.

See Also:
Constant Field Values

MAX_SENT_LENGTH_CHARS

private static final int MAX_SENT_LENGTH_CHARS
Maximum length of a sentence in characters to be considered for predicate extraction.

See Also:
Constant Field Values

MAX_SENT_LENGTH_TOKENS

private static final int MAX_SENT_LENGTH_TOKENS
Maximum length of a sentence in tokens to be considered for predicate extraction.

See Also:
Constant Field Values
Constructor Detail

PredicateExtractionFilter

public PredicateExtractionFilter()
Method Detail

extractNes

private java.util.Map<java.lang.String,java.lang.String[]> extractNes(java.lang.String sentence,
                                                                      java.lang.String[] answerTypes)
Extracts NEs of the expected answer types from a sentence.

Parameters:
sentence - the sentence
answerTypes - the expected answer types
Returns:
NEs and their types

getAllVerbForms

private java.util.Hashtable<java.lang.String[],java.lang.Double> getAllVerbForms(Predicate[] ps)
Gets all forms of the verbs and expansions of predicates with missing arguments. The verb forms are associated with their weights.

Parameters:
ps - predicates
Returns:
verb forms and their weights

checkSentence

private boolean checkSentence(Result sentence)
Decides if predicates should be extracted from this sentence. If the sentence passes the tests, NEs of the expected answer types and terms are extracted and added to the result.

Parameters:
sentence - sentence-level result
Returns:
true iff the sentence is relevant

apply

public Result[] apply(Result[] results)
Extracts relevant predicates from documents.

Overrides:
apply in class Filter
Parameters:
results - array of Result objects containing documents
Returns:
array of Result objects containing predicates