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

R-CMD-check CRAN version Coverage status

Installation

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")

Basic usage

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)

Learning more



crew102/slowraker documentation built on Sept. 5, 2024, 11:22 a.m.