public class LexicalStructureElementSimilarity extends VectorBasedStructureElementSimilarity
StructureElements. A strict label matching is applied on all
structure elements whose type differs LexicalStructureElement.
Similarity between LexicalStructureElements is estimated by projecting
represented words in a WordSpace and evaluating a Kernel function between
these vectors. By default a dot product provided by a LinearKernel is estimated.
VECTOR_NAME| Constructor and Description |
|---|
LexicalStructureElementSimilarity() |
LexicalStructureElementSimilarity(WordspaceI wordspace) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAllowDifferentPOS()
Returns whether the similarity between words having different Part-of-Speech is allowed
or if it must be set to 0
|
boolean |
getIgnorePosInLemmaMatches()
Returns whether two lexical structure elements must provide a perfect match if their lemmas are the same,
regardless their part-of-speeches
|
void |
setAllowDifferentPOS(boolean allowDifferentPOS)
Sets whether the similarity between words having different Part-of-Speech is allowed
or if it must be set to 0
|
void |
setIgnorePosInLemmaMatches(boolean ignorePosInLemmaMatches)
Sets whether two lexical structure elements must provide a perfect match if their lemmas are the same,
regardless their part-of-speeches
|
float |
sim(StructureElement sx,
StructureElement sz)
This function measure the similarity between structure elements
|
getCorrespondingVector, getEnrichmentName, getKernel, getSimilarity, getWordspace, setEnrichmentName, setKernel, setWordspacepublic LexicalStructureElementSimilarity()
public LexicalStructureElementSimilarity(WordspaceI wordspace) throws NumberFormatException, IOException
matrixPath - The path of the wordSpace to be loaded.
By default the wordpspace will be of the class WordpspaceNumberFormatExceptionIOExceptionpublic float sim(StructureElement sx, StructureElement sz)
StructureElementSimilarityIsx - the first structure elementsz - the second structure elementpublic boolean getAllowDifferentPOS()
public void setAllowDifferentPOS(boolean allowDifferentPOS)
allowDifferentPOS - public boolean getIgnorePosInLemmaMatches()
public void setIgnorePosInLemmaMatches(boolean ignorePosInLemmaMatches)
ignorePosInLemmaMatches - whether two lexical structure elements must provide a perfect match if their lemmas are the same,
regardless their part-of-speechesCopyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.