Skip to content

Commit

Permalink
Merge pull request #18 from AdamSpannbauer/damping_fix
Browse files Browse the repository at this point in the history
Damping fix
  • Loading branch information
AdamSpannbauer authored Dec 4, 2018
2 parents 9518877 + 3815546 commit b593122
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: lexRankr
Type: Package
Title: Extractive Summarization of Text with the LexRank Algorithm
Version: 0.5.1
Version: 0.5.2
Author: Adam Spannbauer [aut, cre], Bryan White [ctb]
Maintainer: Adam Spannbauer <[email protected]>
Description: An R implementation of the LexRank algorithm described by G. Erkan and D. R. Radev (2004) <DOI:10.1613/jair.1523>.
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

# lexRankr 0.5.2

* fix damping bug where damping parameter wasn't passed to `igraph::pagerank`

# lexRankr 0.5.1

* changed `smart_stopwords` to be internal data so that package doesnt need to be explicitly loaded with `library` to be able to parse
Expand Down
2 changes: 1 addition & 1 deletion R/lexRankFromSimil.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lexRankFromSimil <- function(s1, s2, simil, threshold=.2, n=3, returnTies=TRUE,
if(length(damping) != 1) stop("damping must be length 1")

sentGraph <- igraph::graph_from_data_frame(edges, directed = FALSE)
sentRank <- igraph::page_rank(sentGraph, directed=FALSE)$vector
sentRank <- igraph::page_rank(sentGraph, directed=FALSE, damping=damping)$vector
sentRanksRanked <- rank(1/sentRank, ties.method = tieMethod)
topCentral <- sentRank[which(sentRanksRanked <= n)]
centralDf <- data.frame(sentenceId=names(topCentral), value=topCentral,stringsAsFactors = FALSE)
Expand Down

0 comments on commit b593122

Please sign in to comment.