get_zipf_metric | R Documentation |
Uses an LLM to estimate a Zipf-based metric (slope) for the given stimulus.
get_zipf_metric(
stimulus,
model = "gpt-3.5-turbo",
api_key = "",
top_p = 1,
temp = 0
)
stimulus |
A character string representing the language material. |
model |
A character string specifying the LLM model (default "gpt-3.5-turbo"). |
api_key |
API key as a character string. |
top_p |
Numeric value (default 1). |
temp |
Numeric value (default 0). |
Default definition: "Zipf's law states that word frequency is inversely proportional to its rank; the Zipf metric is the slope of the log-log frequency vs. rank plot."
A numeric value representing the Zipf metric.
## Not run:
zipf_metric <- get_zipf_metric("The quick brown fox jumps over the lazy dog",
model = "gpt-3.5-turbo",
api_key = "your_api_key")
cat("Zipf Metric:", zipf_metric, "\n")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.