Skip to contents

Extract TextRank-ranked keywords from a single in-memory string with a TextRank worker created by worker(). This is separate from keywords(), which uses TF-IDF weighting.

Usage

textrank(code, jiebar, ..., format = c("vector", "data.frame", "legacy"))

Arguments

code

A character to analyze.

jiebar

A jieba_worker object created with worker(type = "textrank").

...

Must be empty. This enforces that optional arguments such as format are supplied with explicit names.

format

Output format. "vector" returns a named numeric vector, "data.frame" returns a data frame with term and weight columns, and "legacy" returns a jiebaR-style character vector with weights in names(). Default is "vector".

Value

TextRank results in the requested format.