Class IDLabelDistance
- java.lang.Object
-
- com.complexible.stardog.docs.nlp.impl.IDLabelDistance
-
- All Implemented Interfaces:
FeatureGenerator
,java.util.function.Consumer<CandidateMention>
public class IDLabelDistance extends java.lang.Object implements FeatureGenerator
Measures the string distance between the mention and the label/ID of the candidate IRI. Labels are acquired through a SPARQL query, such as:SELECT * FROM <tag:stardog:api:context:all> WHERE { OPTIONAL { ?subj rdfs:label ?0 } OPTIONAL { ?subj foaf:name ?1 } OPTIONAL { ?subj dc:title ?2 } }
- Since:
- 5.2
- Version:
- 5.2
- Author:
- Pedro Oliveira
-
-
Field Summary
Fields Modifier and Type Field Description static IRI[]
DEFAULT_CONTEXTS
static IRI[]
DEFAULT_LABEL_PROPERTIES
static org.apache.lucene.search.spell.StringDistance
DEFAULT_STRING_DISTANCE
static java.lang.String
ID_DISTANCE
static java.lang.String
LABEL_DISTANCE
-
Constructor Summary
Constructors Constructor Description IDLabelDistance(Connection theConnection)
IDLabelDistance(Connection theConnection, org.apache.lucene.search.spell.StringDistance theStringDistance, IRI... theLabelProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(CandidateMention theCandidate)
IRI[]
getContexts()
void
setContexts(IRI... theContexts)
-
-
-
Field Detail
-
ID_DISTANCE
public static final java.lang.String ID_DISTANCE
- See Also:
- Constant Field Values
-
LABEL_DISTANCE
public static final java.lang.String LABEL_DISTANCE
- See Also:
- Constant Field Values
-
DEFAULT_STRING_DISTANCE
public static final org.apache.lucene.search.spell.StringDistance DEFAULT_STRING_DISTANCE
-
DEFAULT_CONTEXTS
public static final IRI[] DEFAULT_CONTEXTS
-
DEFAULT_LABEL_PROPERTIES
public static final IRI[] DEFAULT_LABEL_PROPERTIES
-
-
Constructor Detail
-
IDLabelDistance
public IDLabelDistance(Connection theConnection)
-
IDLabelDistance
public IDLabelDistance(Connection theConnection, org.apache.lucene.search.spell.StringDistance theStringDistance, IRI... theLabelProperties)
-
-
Method Detail
-
getContexts
public IRI[] getContexts()
-
setContexts
public void setContexts(IRI... theContexts)
-
accept
public void accept(CandidateMention theCandidate)
- Specified by:
accept
in interfacejava.util.function.Consumer<CandidateMention>
-
-