public class TextSimilarity
extends java.lang.Object
Constructor and Description |
---|
TextSimilarity() |
Modifier and Type | Method and Description |
---|---|
static float |
directedTextSimilarity(java.lang.String text,
java.lang.String hypothesis,
DISCO disco,
DISCO.SimilarityMeasure similarityMeasure)
Compute the semantic similarity of text and hypothesis according to the
algorithm given in Jijkoun & De Rijke (2005): "Recognizing Textual Entailment
Using Lexical Similarity".
The method tests if the hypothesis is licensed by the text. |
static float |
textSimilarity(java.lang.String text1,
java.lang.String text2,
DISCO disco,
DISCO.SimilarityMeasure similarityMeasure)
Computes the semantic similarity between the two texts as an average of
both directed text similarities.
|
public static float directedTextSimilarity(java.lang.String text, java.lang.String hypothesis, DISCO disco, DISCO.SimilarityMeasure similarityMeasure) throws CorruptConfigFileException, java.io.IOException
text
- a short piece of texthypothesis
- another short text to be checked against the first onedisco
- similarityMeasure
- use SimilarityMeasure.COSINE
with
word spaces imported from word2vec.CorruptConfigFileException
java.io.IOException
public static float textSimilarity(java.lang.String text1, java.lang.String text2, DISCO disco, DISCO.SimilarityMeasure similarityMeasure) throws CorruptConfigFileException, java.io.IOException
text1
- a short piece of texttext2
- another short piece of textdisco
- a DISCO word spacesimilarityMeasure
- use SimilarityMeasure.COSINE
with
word spaces imported from word2vec.CorruptConfigFileException
java.io.IOException