Skip to contents

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

Usage

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

Arguments

code

A character to analyze.

jiebar

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

...

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 the old jiebaR style character vector with weights in names(). Default is "vector".

Value

Keyword results in the requested format.