edu.columbia.cs.cg.prdualrank.inference.quest.impl
Class MatricesBasedQuestCalculator<T extends Matchable,D extends Document>

java.lang.Object
  extended by edu.columbia.cs.cg.prdualrank.inference.quest.impl.MatricesBasedQuestCalculator<T,D>
All Implemented Interfaces:
QuestCalculator<T,D>

public class MatricesBasedQuestCalculator<T extends Matchable,D extends Document>
extends java.lang.Object
implements QuestCalculator<T,D>

This class is used for our implementation of: "Searching Patterns for Relation Extraction over the Web: Rediscovering the Pattern-Relation Duality" . Y. Fang and K. C.-C. Chang. In WSDM, pages 825-834, 2011. For further information, WSDM 2011 Conference Website .

Description

QuestCalculator based on Matrix Multiplication. Useful for fully-connected graphs or for graphs that will take a long number of iterations to converge.
For sparse graphs, see MapBasedQuestCalculator.
For more information, please read the Inference formulas in Figure 4 of the mentioned paper.

Since:
2011-10-07
Version:
0.1
Author:
Pablo Barrio, Goncalo Simoes
See Also:
WSDM 2011 Conference Website , MapBasedQuestCalculator

Constructor Summary
MatricesBasedQuestCalculator()
          Instantiates a new matrices based quest calculator.
MatricesBasedQuestCalculator(int numberIterations)
          Instantiates a new matrices based quest calculator specifying a limited number of iterations.
 
Method Summary
 java.util.Map<Pattern<T,D>,java.lang.Double> getPatternPrecisionMap()
          Gets the Pattern-Precision map (containing the calculated precisions by QuestP)
 java.util.Map<Pattern<T,D>,java.lang.Double> getPatternRecallMap()
          Gets the Pattern-Recall map (containing the calculated recalls by QuestR).
 java.util.Map<Relationship,java.lang.Double> getTuplePrecisionMap()
          Gets the Tuple-Precision map (containing the calculated precisions by QuestP).
 java.util.Map<Relationship,java.lang.Double> getTupleRecallMap()
          Gets the Tuple-Recall map (containing the calculated recalls by QuestR).
 void runQuestP(PRDualRankGraph<T,D> gs)
          Run QuestP (precision) as stated in PRDualRank paper.
 void runQuestR(PRDualRankGraph<T,D> gs)
          Run QuestR (recall) as stated in PRDualRank paper.
 void setSeeds(java.util.Set<Relationship> seeds)
          Sets the initial seeds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatricesBasedQuestCalculator

public MatricesBasedQuestCalculator()
Instantiates a new matrices based quest calculator.


MatricesBasedQuestCalculator

public MatricesBasedQuestCalculator(int numberIterations)
Instantiates a new matrices based quest calculator specifying a limited number of iterations.

Parameters:
numberIterations - the number iterations to be simulated.
Method Detail

runQuestP

public void runQuestP(PRDualRankGraph<T,D> gs)
Description copied from interface: QuestCalculator
Run QuestP (precision) as stated in PRDualRank paper.

Specified by:
runQuestP in interface QuestCalculator<T extends Matchable,D extends Document>
Parameters:
gs - the graph containing related elements (patterns and tuples, for instance).

runQuestR

public void runQuestR(PRDualRankGraph<T,D> gs)
Description copied from interface: QuestCalculator
Run QuestR (recall) as stated in PRDualRank paper.

Specified by:
runQuestR in interface QuestCalculator<T extends Matchable,D extends Document>
Parameters:
gs - the graph containing related elements (patterns and tuples, for instance).

getTuplePrecisionMap

public java.util.Map<Relationship,java.lang.Double> getTuplePrecisionMap()
Description copied from interface: QuestCalculator
Gets the Tuple-Precision map (containing the calculated precisions by QuestP).

Specified by:
getTuplePrecisionMap in interface QuestCalculator<T extends Matchable,D extends Document>
Returns:
the Tuple-Precision map

getTupleRecallMap

public java.util.Map<Relationship,java.lang.Double> getTupleRecallMap()
Description copied from interface: QuestCalculator
Gets the Tuple-Recall map (containing the calculated recalls by QuestR).

Specified by:
getTupleRecallMap in interface QuestCalculator<T extends Matchable,D extends Document>
Returns:
the Tuple-Recall map

getPatternPrecisionMap

public java.util.Map<Pattern<T,D>,java.lang.Double> getPatternPrecisionMap()
Description copied from interface: QuestCalculator
Gets the Pattern-Precision map (containing the calculated precisions by QuestP)

Specified by:
getPatternPrecisionMap in interface QuestCalculator<T extends Matchable,D extends Document>
Returns:
the Pattern-Precision map

getPatternRecallMap

public java.util.Map<Pattern<T,D>,java.lang.Double> getPatternRecallMap()
Description copied from interface: QuestCalculator
Gets the Pattern-Recall map (containing the calculated recalls by QuestR).

Specified by:
getPatternRecallMap in interface QuestCalculator<T extends Matchable,D extends Document>
Returns:
the Pattern-Recall map

setSeeds

public void setSeeds(java.util.Set<Relationship> seeds)
Description copied from interface: QuestCalculator
Sets the initial seeds.

Specified by:
setSeeds in interface QuestCalculator<T extends Matchable,D extends Document>
Parameters:
seeds - the initial seeds