lexRank | R Documentation |
Compute LexRanks from a vector of documents using the page rank algorithm or degree centrality the methods used to compute lexRank are discussed in "LexRank: Graph-based Lexical Centrality as Salience in Text Summarization."
lexRank(text, docId = "create", threshold = 0.2, n = 3, returnTies = TRUE, usePageRank = TRUE, damping = 0.85, continuous = FALSE, sentencesAsDocs = FALSE, removePunc = TRUE, removeNum = TRUE, toLower = TRUE, stemWords = TRUE, rmStopWords = TRUE, Verbose = TRUE)
text |
A character vector of documents to be cleaned and processed by the LexRank algorithm |
docId |
A vector of document IDs with length equal to the length of |
threshold |
The minimum simil value a sentence pair must have to be represented in the graph where lexRank is calculated. |
n |
The number of sentences to return as the extractive summary. The function will return the top |
returnTies |
|
usePageRank |
|
damping |
The damping factor to be passed to page rank algorithm. Ignored if |
continuous |
|
sentencesAsDocs |
|
removePunc |
|
removeNum |
|
toLower |
|
stemWords |
|
rmStopWords |
|
Verbose |
|
A 2 column dataframe with columns sentenceId
and value
. sentence
contains the ids of the top n
sentences in descending order by value
. value
contains page rank score (if usePageRank==TRUE
) or degree centrality (if usePageRank==FALSE
).
http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume22/erkan04a-html/erkan04a.html
lexRank(c("This is a test.","Tests are fun.", "Do you think the exam will be hard?","Is an exam the same as a test?", "How many questions are going to be on the exam?"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.