public class BinaryRelationMatch
extends Object
Modifier and Type | Field and Description |
---|---|
private Graph |
_masterGraph |
private String |
_masterName |
private ArrayList<MatchedBinaryTuple> |
_masterScoredTuples |
private ArrayList<MatchedBinaryTuple> |
_masterTuples
Unlike ConceptManager, this class uses MatchedBinaryTuple's, not an unstructured table entry array list.
|
private Graph |
_toMatchGraph |
private String |
_toMatchName |
private ArrayList<MatchedBinaryTuple> |
_toMatchTuples |
private AbstractTupleMatcher |
_tupleMatcher |
protected NumberFormat |
ff
Used for displaying floating point scores
|
protected NumberFormat |
intf
Used for displaying integer values.
|
protected float |
masterScore |
protected float |
matchedScore |
protected float |
precision |
protected float |
recall |
Constructor and Description |
---|
BinaryRelationMatch(Graph masterG,
String masterName)
Set up a matcher to be used by matchBinaryRelations/1
|
BinaryRelationMatch(Graph masterG,
String masterName,
Graph toMatchGraph,
String toMatchName)
Create a match between a master graph and a match candidate.
|
Modifier and Type | Method and Description |
---|---|
String |
convertTuplesToHTMLtable(ArrayList tuples,
String summary)
Converts a ArrayList of BinaryTuples to an HTML work sheet (usable for manual analysis of the relations), with a summary.
|
String |
getMasterName()
Returns the name of the master graph
|
float |
getMasterScore()
Returns the total score obtainable; i.e., the max score of the master tuples
|
float |
getMatchedMaxPossibleScore()
Returns the max score possible derived from the graph to match; i.e., the "count" of everything
in the graph to match.
|
String |
getMatchedName()
Returns the name of the graph to be matched
|
float |
getMatchedScore()
Returns the raw score obtained; i.e., the "count" of the things matched.
|
float |
getNormScore() |
float |
getPrecision()
Returns the percentage of things in the graph to match that also appear in the master.
|
float |
getRecall()
Returns the percentage of things in the master that also appear in the graph to match.
|
static String |
getSummaryHeaderHTML() |
String |
getSummaryHTML()
Return a one-line HTML TR summary, suitable for inclusion in an HTML table
|
float |
getTotalScore(ArrayList v) |
AbstractTupleMatcher |
getTupleMatcher() |
ArrayList<MatchedBinaryTuple> |
makeBinaryTuples(Graph masterG)
Mimics getBinaryRelationTuples, but constructs a vector of BinaryTuple objects.
|
String |
masterDetailToHTML()
Displays the details of the master graph in HTML form.
|
void |
matchAGraph(Graph toMatchGraph,
String toMatchName) |
String |
matchedDetailToHTML() |
void |
matchTheTuples() |
void |
matchTheTuplesByMaster()
Performs the actual matching algorithm on two given graphs, considering each row of the master in turn.
|
void |
matchTheTuplesByMatchedTuples()
Performs the actual matching algorithm on two given graphs,
considering each row of the to-be-matched graph in turn.
|
void |
setTupleMatcher(AbstractTupleMatcher m)
Tell the relation matcher which specific tuple matcher objects to use.
|
void |
setupMaster(Graph masterG)
Load the matcher with an entry for each binary relation.
|
protected float masterScore
protected float matchedScore
protected float precision
protected float recall
protected NumberFormat intf
protected NumberFormat ff
private ArrayList<MatchedBinaryTuple> _masterTuples
private ArrayList<MatchedBinaryTuple> _masterScoredTuples
private ArrayList<MatchedBinaryTuple> _toMatchTuples
private AbstractTupleMatcher _tupleMatcher
private Graph _masterGraph
private Graph _toMatchGraph
private String _masterName
private String _toMatchName
public BinaryRelationMatch(Graph masterG, String masterName, Graph toMatchGraph, String toMatchName)
masterG
- the graph to serve as the "correct" or master graph of the comparison.masterName
- a label for the master graphtoMatchGraph
- the graph to be matched to the mastertoMatchName
- a label for the toMatch graphpublic BinaryRelationMatch(Graph masterG, String masterName)
masterG
- the graph to serve as the "correct" or master graph of the comparison.masterName
- a label for the master graphpublic AbstractTupleMatcher getTupleMatcher()
public void setTupleMatcher(AbstractTupleMatcher m)
m
- public float getTotalScore(ArrayList v)
public float getMasterScore()
public float getMatchedScore()
public float getMatchedMaxPossibleScore()
public float getPrecision()
public float getRecall()
public float getNormScore()
public String getMasterName()
public String getMatchedName()
public void matchAGraph(Graph toMatchGraph, String toMatchName)
public void setupMaster(Graph masterG)
public String convertTuplesToHTMLtable(ArrayList tuples, String summary)
tuples
- a ArrayList of BinaryTuple or one of its subclasses.summary
- an identifying string, used to identify the table in HTML, but not otherwise displayed.public String getSummaryHTML()
public static String getSummaryHeaderHTML()
public String masterDetailToHTML()
public String matchedDetailToHTML()
public ArrayList<MatchedBinaryTuple> makeBinaryTuples(Graph masterG)
masterG
- graph whose tuples are to be collectedConceptManager.getBinaryRelationTuples(charger.obj.Graph, kb.ConceptManager.ConceptsToInclude)
public void matchTheTuples()
public void matchTheTuplesByMatchedTuples()
getSummaryHTML()
public void matchTheTuplesByMaster()