keywords: Extract keywords from text

View source: R/keywords.R

keywordsR Documentation

Extract keywords from text

Description

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.


jiebaRS documentation built on Oct. 13, 2026, 5:07 p.m.