-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
77 lines (56 loc) · 2.23 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
output: github_document
title: "slowraker"
---
```{r, echo = FALSE, message = FALSE}
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](https://github.com/crew102/slowraker/workflows/R-CMD-check/badge.svg)](https://github.com/crew102/slowraker/actions)
[![CRAN version](https://www.r-pkg.org/badges/version/slowraker)](https://cran.r-project.org/package=slowraker)
[![Coverage status](https://codecov.io/gh/crew102/slowraker/branch/master/graph/badge.svg)](https://codecov.io/github/crew102/slowraker?branch=master)
## Installation
You can get the stable version from CRAN:
```r
install.packages("slowraker")
```
Or the development version from GitHub:
```r
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:
```{r, eval = FALSE}
library(slowraker)
data("dog_pubs")
rakelist <- slowrake(txt = dog_pubs$abstract[1:5])
```
```{r, eval = TRUE, results = 'hide', echo = FALSE}
# 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:
```{r}
rakelist
```
You can bind these data frames together using `rbind_rakelist()`:
```{r}
rakedf <- rbind_rakelist(rakelist, doc_id = dog_pubs$doi[1:5])
head(rakedf, 5)
```
## Learning more
* To learn about how RAKE works as well as the basics of `slowrake()`, check out the "Getting started" vignette (`vignette("getting-started")`). Frequently asked questions are answered in the FAQs vignette (`vignette("faqs")`).
* All documentation is also on the package's [website](https://crew102.github.io/slowraker/index.html)