as_rag_table: Convert RAG JSON to a table

View source: R/rag_json.R

as_rag_tableR Documentation

Convert RAG JSON to a table

Description

Produces a long-form data.frame with columns: 'label', 'confidence', 'intensity', 'doc_id', 'span', 'score'.

Usage

as_rag_table(x, validate = TRUE)

Arguments

x

JSON string or parsed list.

validate

Logical; validate structure first.

Value

A data.frame suitable for statistical analysis.

Examples

j <- '{"labels":["joy","surprise"],"confidences":[0.8,0.5],
  "intensity":0.7,"evidence_chunks":[]}'
as_rag_table(j)

transforEmotion documentation built on Jan. 8, 2026, 5:06 p.m.