deeplearning4j-scaleout/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/wordvectors/WordVectorsImpl.java
/**
     * Returns the similarity of 2 words. Result value will be in range [-1,1], where -1.0 is exact opposite similarity, i.e. NO similarity, and 1.0 is total match of two word vectors.
     * However, most of time you'll see values in range [0,1], but that's something depends of training corpus.
     *
     * @param word the first word
     * @param word2 the second word
     * @return a normalized similarity (cosine similarity)
     */
Returns the similarity of 2 words. Result value will be in range [-1,1], where -1.0 is exact opposite similarity, i.e. NO similarity, and 1.0 is total match of two word vectors.
However, most of time you'll see values in range [0,1], but that's something depends of training corpus.

@param word the first word
@param word2 the second word
@return a normalized similarity (cosine similarity)
Returns the similarity of 2 words . Result value will be in range [ - 1 1 ] where - 1 . 0 is exact opposite similarity i . e . NO similarity and 1 . 0 is total match of two word vectors . However most of time you ' ll see values in range [ 0 1 ] but that ' s something depends of training corpus . @param word the first word @param word2 the second word @return a normalized similarity ( cosine similarity )
public double similarity(String word,String word2) {
        if(word.equals(word2))
            return 1.0;
        if(getWordVectorMatrix(word) == null || getWordVectorMatrix(word2) == null)
            return -1;
        return  Transforms.cosineSim(getWordVectorMatrix(word), getWordVectorMatrix(word2));
    }
public double similarity ( String word , String word2 ) { if ( word . equals ( word2 ) ) return 1.0 ; if ( getWordVectorMatrix ( word ) == null || getWordVectorMatrix ( word2 ) == null ) return - 1 ; return Transforms . cosineSim ( getWordVectorMatrix ( word ) , getWordVectorMatrix ( word2 ) ) ; }
Returns the similarity of 2 words.
Returns the similarity of 2 words .