|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.questionanalysis.TermExpander
public class TermExpander
Expands single- and multi-token terms by looking them up in one or more open- or specific-domain ontologies.
| Field Summary | |
|---|---|
static int |
MAX_EXPANSIONS
Maximum number of expansions. |
static int |
MAX_EXPANSIONS_QUERY
Maximum number of expansions used in a query. |
static double |
MIN_EXPANSION_WEIGHT
Minimum weight of an expansion. |
static double |
MIN_EXPANSION_WEIGHT_QUERY
Minimum weight of an expansion used in a query. |
| Constructor Summary | |
|---|---|
TermExpander()
|
|
| Method Summary | |
|---|---|
static double |
cutOffExpansions(java.util.Map<java.lang.String,java.lang.Double> expansions,
boolean strict)
Drops expansions that do not contain any keywords and applies the default thresholds for the maximum number of expansions and the minimum weight of an expansion. |
static double |
cutOffExpansions(java.util.Map<java.lang.String,java.lang.Double> expansions,
int maxExpansions,
double minExpansionWeight,
boolean strict)
Drops expansions that do not contain any keywords and applies the given thresholds for the maximum number of expansions and the minimum weight of an expansion. |
static java.util.Map<java.lang.String,java.lang.Double> |
expandPhrase(java.lang.String phrase,
Term[] terms)
Expands a phrase by replacing the terms that occur within the phrase by their expansions. |
static void |
expandTerm(Term term,
Predicate[] ps,
Ontology[] ontologies)
Expands a term by looking up related terms in ontologies. |
static void |
expandTerms(Term[] terms,
Predicate[] ps,
Ontology[] ontologies)
Expands all terms by looking up related terms in ontologies. |
private static boolean |
isTarget(Term term,
Predicate[] ps)
Checks if the term is the target of one of the predicates. |
static java.util.Map<java.lang.String,java.lang.Double> |
reduceExpansionsQuery(java.util.Map<java.lang.String,java.lang.Double> expansions,
boolean strict)
Creates a new expansion map and applies the thresholds for the maximum number of expansions and the minimum weight of an expansion for queries. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_EXPANSIONS
public static final double MIN_EXPANSION_WEIGHT
public static final int MAX_EXPANSIONS_QUERY
public static final double MIN_EXPANSION_WEIGHT_QUERY
| Constructor Detail |
|---|
public TermExpander()
| Method Detail |
|---|
private static boolean isTarget(Term term,
Predicate[] ps)
term - a termps - predicates in the same sentence
true iff the term is a predicate target
public static double cutOffExpansions(java.util.Map<java.lang.String,java.lang.Double> expansions,
int maxExpansions,
double minExpansionWeight,
boolean strict)
expansions - expansions along with their weightsmaxExpansions - maximum number of expansionsminExpansionWeight - minimum weight of an expansionstrict - iff true, the threshold for the maximum number
of expansions is applied strictly even if that means that
some of a number of expansion with equal weights have to be
dropped randomly
public static double cutOffExpansions(java.util.Map<java.lang.String,java.lang.Double> expansions,
boolean strict)
expansions - expansions along with their weightsstrict - iff true, the threshold for the maximum number
of expansions is applied strictly even if that means that
some of a number of expansion with equal weights have to be
dropped randomly
public static java.util.Map<java.lang.String,java.lang.Double> reduceExpansionsQuery(java.util.Map<java.lang.String,java.lang.Double> expansions,
boolean strict)
expansions - expansions along with their weightsstrict - iff true, the threshold for the maximum number
of expansions is applied strictly even if that means that
some of a number of expansion with equal weights have to be
dropped randomly
public static void expandTerm(Term term,
Predicate[] ps,
Ontology[] ontologies)
term - a termps - predicates in the same sentenceontologies - ontologies used to expand the term
public static void expandTerms(Term[] terms,
Predicate[] ps,
Ontology[] ontologies)
terms - the termsps - predicates in the same sentenceontologies - ontologies used to expand the term
public static java.util.Map<java.lang.String,java.lang.Double> expandPhrase(java.lang.String phrase,
Term[] terms)
MAX_EXPANSIONS resulting phrases with the highest weights
are returned.
phrase - phrase to expandterms - expanded terms that potentially occur within the phrase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||