knitr::opts_chunk$set( collapse = TRUE, comment = "#>", progress = FALSE, error = FALSE, message = FALSE, warning = FALSE )
A slow version of the Rapid Automatic Keyword Extraction (RAKE) algorithm
You can get the stable version from CRAN:
install.packages("slowraker")
Or the development version from GitHub:
if (!"devtools" %in% rownames(installed.packages())) install.packages("devtools") devtools::install_github("crew102/slowraker")
There is one main function in the slowraker
package - slowrake()
. slowrake()
extracts keywords from a vector of documents using the RAKE algorithm. This algorithm doesn't require any training data, so it's super easy to use:
library(slowraker) data("dog_pubs") rakelist <- slowrake(txt = dog_pubs$abstract[1:5])
# Note, we have to split the README.Rmd up like this so that it doesn't print # the progress bar. library(slowraker) options(width = 100, digits = 2) data("dog_pubs") rakelist <- slowrake(txt = dog_pubs$abstract[1:5])
slowrake()
outputs a list of data frames. Each data frame contains the keywords that were extracted for a given document:
rakelist
You can bind these data frames together using rbind_rakelist()
:
rakedf <- rbind_rakelist(rakelist, doc_id = dog_pubs$doi[1:5]) head(rakedf, 5)
slowrake()
, check out the "Getting started" vignette (vignette("getting-started")
). Frequently asked questions are answered in the FAQs vignette (vignette("faqs")
).Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.