View source: R/sentenceSimil.R
sentenceSimil | R Documentation |
Compute distance between sentences using modified idf cosine distance from "LexRank: Graph-based Lexical Centrality as Salience in Text Summarization". Output can be used as input to lexRankFromSimil
.
sentenceSimil(sentenceId, token, docId = NULL, sentencesAsDocs = FALSE)
sentenceId |
A character vector of sentence IDs corresponding to the |
token |
A character vector of tokens corresponding to the |
docId |
A character vector of document IDs corresponding to the |
sentencesAsDocs |
|
A 3 column dataframe of pairwise distances between sentences. Columns: sent1
(sentence id), sent2
(sentence id), & dist
(distance between sent1
and sent2
).
http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume22/erkan04a-html/erkan04a.html
sentenceSimil(docId=c("d1","d1","d2","d2"), sentenceId=c("d1_1","d1_1","d2_1","d2_1"), token=c("i", "ran", "jane", "ran"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.