SentenceSimilarity | R Documentation |
Get similar sentences.
Get similar sentences.
getSentenceVectors(method = c("pos", "openNLP"), f = mean, stopwords = tm::stopwords("de"), tfidf = FALSE, verbose = TRUE)
partition
a partition
getSentenceVectors()
SentenceSimilarity$getSentenceVectors( method = c("pos", "openNLP"), f = mean, stopwords = tm::stopwords("de"), tfidf = FALSE, verbose = TRUE )
getSentenceVector()
SentenceSimilarity$getSentenceVector(sentence)
getSentenceSimilarity()
SentenceSimilarity$getSentenceSimilarity(x, n = NULL, text = TRUE)
getSimilarityMatrix()
SentenceSimilarity$getSimilarityMatrix()
getSimilarSentences()
SentenceSimilarity$getSimilarSentences(i, n = 10)
clone()
The objects of this class are cloneable with this method.
SentenceSimilarity$clone(deep = FALSE)
deep
Whether to make a deep clone.
## Not run: library(R6) library(NLP) library(openNLP) library(openNLPmodels.de) library(polmineR) filename <- "/Users/blaette/Lab/tmp/word2vec/word2vec/data/plprbt_word2vec.csv" W2V <- Word2Vec$new() W2V$load(filename) merkel <- partition("PLPRBT", speaker_name = "Angela Merkel", speaker_year = "2015") S <- SentenceSimilarity$new() S$partition <- merkel S$word2vec <- W2V$vector_matrix S$threads <- 3 S$getSentenceVectors(method = "pos", f = sum) S$getSimilarityMatrix() i <- 549 S$sentences[[i]] sentence <- c("Kriminelle", "Ausländer", "raus", "und", "zwar", "schnell") S$getSentenceSimilarity(sentence) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.