Skip to contents

Validates and wraps a data frame of scholarly fields and their definitions into a pc_taxonomy object for use with pc_classify(). A taxonomy provides the controlled vocabulary that the LLM assigns publications to.

Usage

pc_taxonomy(x)

Arguments

x

A data frame with exactly two columns:

  • field: unique field names (character)

  • definition: free-text descriptions used by the LLM for classification (character)

Alternatively, a file path (character) pointing to a CSV with those two columns.

Value

An object of class pc_taxonomy (a validated data frame with columns field and definition).

Examples

tax <- pc_taxonomy(data.frame(
  field      = c("Ecology", "Economics", "Computer Science"),
  definition = c(
    "Study of organisms and their interactions with the environment.",
    "Study of production, distribution, and consumption of goods.",
    "Study of computation, algorithms, and information systems."
  )
))
print(tax)
#> 
#> ── pubclassify taxonomy (3 fields) ─────────────────────────────────────────────
#> • Ecology: Study of organisms and their interactions with the environment.
#> • Economics: Study of production, distribution, and consumption of goods.
#> • Computer Science: Study of computation, algorithms, and information systems.