hf_ez_token_classification_local_inference: Token Classification Local Inference

View source: R/ez.R

hf_ez_token_classification_local_inferenceR Documentation

Token Classification Local Inference

Description

Token Classification Local Inference

Usage

hf_ez_token_classification_local_inference(
  string,
  aggregation_strategy = "simple",
  tidy = TRUE,
  ...
)

Arguments

string

a string to be classified

aggregation_strategy

(Default: simple). There are several aggregation strategies.
none: Every token gets classified without further aggregation.
simple: Entities are grouped according to the default schema (B-, I- tags get merged when the tag is similar).
first: Same as the simple strategy except words cannot end up with different tags. Words will use the tag of the first token when there is ambiguity.
average: Same as the simple strategy except words cannot end up with different tags. Scores are averaged across tokens and then the maximum label is applied.
max: Same as the simple strategy except words cannot end up with different tags. Word entity will be the token with the maximum score.

tidy

Whether to tidy the results into a tibble. Default: TRUE (tidy the results)

Value

The results of the inference

See Also

https://huggingface.co/docs/transformers/main/en/pipeline_tutorial


farach/huggingfaceR documentation built on Feb. 4, 2023, 10:31 p.m.