rt_ai_pmc: Identify disclosure of generative-AI use from a PMC XML file.

View source: R/rt_ai.R

rt_ai_pmcR Documentation

Identify disclosure of generative-AI use from a PMC XML file.

Description

Detects whether an article discloses the use (or non-use) of generative AI or AI-assisted tools in preparing the manuscript, as required of articles since 2023. The indicator is only evaluated for articles published in 2023 or later; for earlier articles 'is_ai_pred' is 'NA'.

Usage

rt_ai_pmc(filename, remove_ns = FALSE)

Arguments

filename

The filename of the PMC XML file to analyze.

remove_ns

TRUE if an XML namespace exists, else FALSE (default).

Value

A tibble with the article IDs, the publication 'year', whether an AI disclosure was found ('is_ai_pred', 'NA' before 2023), the matched statement ('ai_text') and 'is_success'.

Examples


filepath <- system.file(
  "extdata", "PMID32171256-PMC7071725.xml", package = "rtransparency"
)
rt_ai_pmc(filepath, remove_ns = TRUE)


rtransparency documentation built on July 1, 2026, 9:07 a.m.