public abstract class CompositionalNodeSimilarity extends LexicalStructureElementSimilarity
| Modifier and Type | Field and Description |
|---|---|
protected String |
enrichmentName |
VECTOR_NAME| Constructor and Description |
|---|
CompositionalNodeSimilarity()
Default constructor, used only for JSON serialization/deserialization
purposes.
|
CompositionalNodeSimilarity(WordspaceI wordspace)
Constructor that enable to specify the wordspace path.
|
CompositionalNodeSimilarity(WordspaceI wordspace,
boolean posRestriction,
boolean syntacticRestriction)
Constructor that enable to specify the wordspace path.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Vector |
getCompositionalInformationFor(LexicalStructureElement head,
LexicalStructureElement modifier)
This method takes in input two LexicalStructureElement representing a
head and a modifier.
|
String |
getEnrichmentName()
Returns the identifier of the vectors associated to
a StructureElement during the manipulation operation performed
by a Manipulator (i.e.
|
protected abstract float |
getScore(CompositionalStructureElement csx,
CompositionalStructureElement csz) |
boolean |
isPosRestriction() |
boolean |
isSyntacticRestriction() |
void |
setEnrichmentName(String enrichmentName)
Sets the identifier of the vectors associated to
a StructureElement during the manipulation operation performed
by a Manipulator (i.e.
|
void |
setPosRestriction(boolean posRestriction) |
void |
setSyntacticRestriction(boolean syntacticRestriction) |
float |
sim(StructureElement sx,
StructureElement sz)
This method computes the similarity between two compositional nodes by
applying the "sum" operator.
|
getAllowDifferentPOS, getIgnorePosInLemmaMatches, setAllowDifferentPOS, setIgnorePosInLemmaMatchesgetCorrespondingVector, getKernel, getSimilarity, getWordspace, setKernel, setWordspaceprotected String enrichmentName
public CompositionalNodeSimilarity()
public CompositionalNodeSimilarity(WordspaceI wordspace) throws NumberFormatException, IOException
getDefaultKernel method. posRestriction
parameter is set to true. syntacticRestriction parameter is
set to false.matrixPath - The path of the Word Space to be loadedNumberFormatExceptionIOExceptionpublic CompositionalNodeSimilarity(WordspaceI wordspace, boolean posRestriction, boolean syntacticRestriction) throws NumberFormatException, IOException
getDefaultKernel method.matrixPath - The path of the Word Space to be loaded.posRestriction - if true, two nodes will be compared only if heads and
modifiers of these nodes will match.syntacticRestriction - if true, two nodes will be compared only if the dependency
relation of these will match.FileNotFoundExceptionIOExceptionNumberFormatExceptionpublic void setEnrichmentName(String enrichmentName)
VectorBasedStructureElementSimilaritysetEnrichmentName in class VectorBasedStructureElementSimilarityenrichmentName - the enrichmentName to setpublic String getEnrichmentName()
VectorBasedStructureElementSimilaritygetEnrichmentName in class VectorBasedStructureElementSimilaritypublic boolean isPosRestriction()
public void setPosRestriction(boolean posRestriction)
posRestriction - the posRestriction to setpublic boolean isSyntacticRestriction()
public void setSyntacticRestriction(boolean syntacticRestriction)
syntacticRestriction - the syntacticRestriction to setpublic float sim(StructureElement sx, StructureElement sz)
sim in interface StructureElementSimilarityIsim in class LexicalStructureElementSimilaritysx - the first structure elementsz - the second structure elementprotected abstract float getScore(CompositionalStructureElement csx, CompositionalStructureElement csz)
public abstract Vector getCompositionalInformationFor(LexicalStructureElement head, LexicalStructureElement modifier)
VECTOR_NAME, containing the
sum of the two vector representations of the head and modifier. In case
of missing head, the resulting composition is obtained by copying the
modifier in the head. In case of missing modifier, the resulting
composition is obtained by copying the head in the modifier. In case of
missing head and modifier, the method returns null.head - modifier - ws - the StructureElementSimilarityWordSpace used to retrieve the
vector representations of head and modifiers.Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.