public class CompositionalNodeSimilarityProduct extends CompositionalNodeSimilarity implements Manipulator
enrichmentName
VECTOR_NAME
Constructor and Description |
---|
CompositionalNodeSimilarityProduct()
Default constructor, used only for JSON serialization/deserialization
purposes.
|
CompositionalNodeSimilarityProduct(WordspaceI wordspace)
Constructor that enable to specify the wordspace path.
|
CompositionalNodeSimilarityProduct(WordspaceI wordspace,
boolean posRestriction,
boolean syntacticRestriction)
Constructor that enable to specify the wordspace path.
|
Modifier and Type | Method and Description |
---|---|
Vector |
getCompositionalInformationFor(LexicalStructureElement head,
LexicalStructureElement modifier)
This method takes in input two LexicalStructureElement representing a
head and a modifier.
|
String |
getRepresentationToBeEnriched() |
protected float |
getScore(CompositionalStructureElement csx,
CompositionalStructureElement csz) |
void |
manipulate(Example example) |
void |
setRepresentationToBeEnriched(String representationToBeEnriched) |
getEnrichmentName, isPosRestriction, isSyntacticRestriction, setEnrichmentName, setPosRestriction, setSyntacticRestriction, sim
getAllowDifferentPOS, getIgnorePosInLemmaMatches, setAllowDifferentPOS, setIgnorePosInLemmaMatches
getCorrespondingVector, getKernel, getSimilarity, getWordspace, setKernel, setWordspace
public CompositionalNodeSimilarityProduct()
public CompositionalNodeSimilarityProduct(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 loadedNumberFormatException
IOException
public CompositionalNodeSimilarityProduct(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.FileNotFoundException
IOException
NumberFormatException
public String getRepresentationToBeEnriched()
public void setRepresentationToBeEnriched(String representationToBeEnriched)
representationToBeEnriched
- the representationToBeEnriched to setprotected float getScore(CompositionalStructureElement csx, CompositionalStructureElement csz)
getScore
in class CompositionalNodeSimilarity
public Vector getCompositionalInformationFor(LexicalStructureElement head, LexicalStructureElement modifier)
VECTOR_NAME
, containing the
pointwise product 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.getCompositionalInformationFor
in class CompositionalNodeSimilarity
head
- modifier
- ws
- the StructureElementSimilarityWordSpace used to retrieve the
Vector representations of head and modifiers.public void manipulate(Example example)
manipulate
in interface Manipulator
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.