get_levenshtein_d | R Documentation |
Uses an LLM to compute the Levenshtein distance (D) between two linguistic stimuli.
get_levenshtein_d(
stimulus1,
stimulus2,
model = "gpt-3.5-turbo",
api_key = "",
top_p = 1,
temp = 0
)
stimulus1 |
A character string representing the first text. |
stimulus2 |
A character string representing the second text. |
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: "Levenshtein distance is defined as the minimum number of single-character edits (insertions, deletions, or substitutions) required to transform one string into another."
A numeric value representing the Levenshtein distance.
## Not run:
lev_dist <- get_levenshtein_d("kitten", "sitting",
model = "gpt-3.5-turbo",
api_key = "your_api_key")
cat("Levenshtein Distance:", lev_dist, "\n")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.