Skip to contents

Accepts a bare probability, a named list carrying toxic, or a (p_benign, p_toxic) pair validated to sum to 1.

Usage

morie_kamath_toxigen_score(text, classifier, threshold = 0.5)

Arguments

text

Text.

classifier

Classifier.

threshold

Cut-off.

Value

List with estimate, toxic, threshold.

Examples

morie_kamath_toxigen_score("t", function(t) c(0.3, 0.7))
#> $estimate
#> [1] 0.7
#> 
#> $probability
#> [1] 0.7
#> 
#> $toxic
#> [1] TRUE
#> 
#> $threshold
#> [1] 0.5
#> 
#> $text
#> [1] "t"
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "ToxiGen classifier toxicity probability"
#>