| textrank_batch | R Documentation |
Convenience wrapper around textrank() for multi-string input. When
batch is not supplied, textrank_batch() returns list output.
textrank_batch(
x,
worker,
...,
format = c("vector", "data.frame", "legacy"),
batch = c("list", "flatten"),
texts = deprecated(),
jiebar = deprecated()
)
x |
A non-empty character vector to analyze. |
worker |
A |
... |
Must be empty. This enforces that optional arguments such as
|
format |
Output format for each document. Must be one of |
batch |
Aggregation mode. Must be one of |
texts, jiebar |
Each string is one document; documents are processed in parallel and up
to topn keywords are ranked within each one. The returned object depends
on both format and batch:
batch = "list": one single-document TextRank result per input string.
batch = "flatten": all results concatenated. "vector"/"legacy"
produce one named vector, while "data.frame" produces a combined data
frame with a leading doc_id column.
TextRank results in the requested format.
ranker <- worker(type = "textrank", topn = 2)
texts <- c(
"\u5317\u4eac\u70e4\u9e2d\u771f\u597d\u5403\uff0c\u5317\u4eac\u70e4\u9e2d",
"\u7ebd\u7ea6\u7684\u5929\u6c14\u771f\u597d\uff0c\u7ebd\u7ea6\u7684\u5929\u6c14"
)
textrank_batch(texts, ranker)
textrank_batch(texts, ranker, format = "data.frame", batch = "flatten")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.