calculate_textplex: Calculate the raw scores

Description Usage Arguments Value Examples

View source: R/metrics.R

Description

This function takes a vector of characters and calculate the raw scores required for the algorithm.

Usage

1
2
3
4
5
6
7
8
9
calculate_textplex(
  input_text,
  parsed_text = NULL,
  mtld_threshold = 0.72,
  mtld_min_ntoken = 10,
  parallel = TRUE,
  .progress = TRUE,
  plan = "multiprocess"
)

Arguments

input_text

vector of characters.

parsed_text

a list of dataframes. Must be parsed with spacyr::spacy_parse(pos = TRUE, dependency = TRUE, tag = TRUE)

mtld_threshold

Threshold for the calculation of MTLD score.

mtld_min_ntoken

Threhold for minimal length of a viable sentence.

parallel

logical, whether or not to use parallel computation.

plan

character, please refer to ?future::plan for other options.

.progrss_bar

logical, whether or not to display progress bar. Only possible when parallel = TRUE.

Value

tibble of raw scores

Examples

1
2
3
4
require(spacyr)
data(fairy)
spacy_initialize(model = 'en')
fairy_rawscore <- calculate_textplex(fairy$text)

chainsawriot/textplex documentation built on March 19, 2020, 3:39 a.m.