public class Entity extends Object implements Serializable, Comparable<Entity>
| Constructor and Description |
|---|
Entity(String name)
Create a new entity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLinkingURI(String uri)
Adds a matching URI to the entity.
|
void |
addProperty(Triple triple)
Adds a new property to the entity.
|
int |
compareTo(Entity other) |
void |
findRank(double f,
double x,
int docLength)
Give a rank to entities using the following formula :
rank = ( # of entity appearances / # of total entities appearances ) * X% +
( # of entity appearances in first f% of text /
# of total entities appearances in first f% of text ) * Y%
|
String |
getCategoryName()
Returns the name of the category that the entity belongs to.
|
Map<Integer,Double> |
getDisambiguationScores()
Returns the disambiguation scores of an entity.
|
Set<String> |
getLinkingURIs()
Returns the matching URIs of the entity.
|
Set<String> |
getMayRefersToName()
Returns the names the real entities of an occurrence of an partial matching term.
|
String |
getName()
Sets/changes the name of the entity.
|
int |
getNumOfOccurrences()
Returns the number of occurrences of the entity.
|
ArrayList<Triple> |
getProperties()
Returns the properties of the entity.
|
double |
getRank()
Returns the rank of the entity.
|
Map<String,Double> |
getRankedLinkingURIs()
Returns the matching URIs of the entity sorted by a given rank function.
|
Map<Integer,String> |
getSnippets()
Returns the sentences that contain an entity.
|
Set<Integer> |
getTextPositions()
Sets/changes the positions of the entity in the text.
|
Map<String,Double> |
getTopLinkingURIs()
Returns the TOP ranked matching URIs of the entity sorted by a given rank function.
|
void |
increaseNumOfOccurrences()
Increments (one unite) the number of occurrences of the entity.
|
void |
rankURIs()
Ranks the retrieved URIs of a specific entity based on their relevance.
|
Object[][] |
rankUrisByEditDistance()
Returns the URIs of an entity sorted by Edit Distance.
|
Object[][] |
rankUrisByStoilosDistance()
Returns the URIs of an entity sorted by Stoilos Distance.
|
void |
setCategoryName(String categoryName)
Sets/changes the name of the category that the entity belongs to.
|
void |
setDisambiguationScores(Map disambiguationScores)
Sets/changes the disambiguation scores of an entity.
|
void |
setLinkingURIs(Set<String> matchingURIs)
Sets/changes the matching URIs of the entity.
|
void |
setMayRefersToName(Set<String> mayRefersToName)
Sets the names of real entities of occurrence of an partial matching term.
|
void |
setMayRefersToName(String mayRefersToName)
Sets the name of the real entities of occurrence of an partial matching term.
|
void |
setName(String name)
Sets/changes the name of the entity.
|
void |
setNumOfOccurrences(int numOfOccurrences)
Sets/changes the number of occurrences of the entity.
|
void |
setProperties(ArrayList<Triple> properties)
Sets/changes the incoming properties of the entity.
|
void |
setRank(double rank)
Sets/changes the rank of the entity.
|
void |
setRankedLinkingURIs(Map<String,Double> URIs)
Sets/changes the ranked URIs of the entity.
|
void |
setSnippets(Map<Integer,String> snippets)
Sets/changes the sentences that contain an entity.
|
void |
setTextPositions(Set<Integer> textPositions)
Sets/changes the positions of the entity in the text.
|
void |
setTopLinkingURIs(Map<String,Double> URIs)
Sets/changes the Top ranked URIs of the entity.
|
String |
toString() |
public Entity(String name)
name - The name of the entity.public String getCategoryName()
public void setCategoryName(String categoryName)
categoryName - The name of the category that the entity belongs to.public String getName()
public void setName(String name)
name - The name of the entity.public ArrayList<Triple> getProperties()
public void setProperties(ArrayList<Triple> properties)
properties - The incoming properties of the entity.public void addProperty(Triple triple)
triple - The new triple/propertypublic double getRank()
public void setRank(double rank)
rank - The rank of the entity.public int getNumOfOccurrences()
public void setNumOfOccurrences(int numOfOccurrences)
numOfOccurrences - The number of occurrences of the entity.public Set<String> getMayRefersToName()
public void setMayRefersToName(Set<String> mayRefersToName)
mayRefersToName - The names of real entities.public void setMayRefersToName(String mayRefersToName)
mayRefersToName - The name of the real entities.public void increaseNumOfOccurrences()
public Set<String> getLinkingURIs()
public Map<String,Double> getTopLinkingURIs() throws IOException
IOExceptionpublic Map<String,Double> getRankedLinkingURIs() throws IOException
IOExceptionpublic void setTopLinkingURIs(Map<String,Double> URIs)
URIs - The top ranked URIs.public void setRankedLinkingURIs(Map<String,Double> URIs)
URIs - The top ranked URIs.public Map<Integer,String> getSnippets()
public void setSnippets(Map<Integer,String> snippets)
snippets - The sentences that contain an entity.public Map<Integer,Double> getDisambiguationScores()
public void setDisambiguationScores(Map disambiguationScores)
disambiguationScores - The disambiguation scores of an entity.public Object[][] rankUrisByEditDistance() throws MalformedURLException, IOException
MalformedURLExceptionIOExceptionpublic Object[][] rankUrisByStoilosDistance() throws MalformedURLException, IOException
MalformedURLExceptionIOExceptionpublic void setLinkingURIs(Set<String> matchingURIs)
matchingURIs - The matching URIs of the entity.public void addLinkingURI(String uri)
uri - The matching URI.public Set<Integer> getTextPositions()
public void setTextPositions(Set<Integer> textPositions)
textPositions - The positions of the entity in the text.public void findRank(double f,
double x,
int docLength)
f - The percentage of document we want to check.x - The weight we give to the 1st part of sum and 1-x the weight
we give to the 2nd part of sum.docLength - The length of the document (in number of chars).public void rankURIs()
throws IOException
IOExceptionpublic int compareTo(Entity other)
compareTo in interface Comparable<Entity>Copyright © 2016. All rights reserved.