create_fine_tune_data: Function to generate dataset to be used for fine-tuning...

View source: R/fine_tune_data.R

create_fine_tune_dataR Documentation

Function to generate dataset to be used for fine-tuning models

Description

This function creates the initial data that can be used to fine tune models from OpenAI.

Usage

create_fine_tune_data(data, prompt, studyid, title, abstract)

Arguments

data

Dataset containing the titles and abstracts.

prompt

Prompt(s) to be added before the title and abstract.

studyid

Unique Study ID. If missing, this is generated automatically.

title

Name of the variable containing the title information.

abstract

Name of variable containing the abstract information.

Value

A dataset of class 'fine_tune_data'.

Note

The dataset contains at least the following variables:

studyid integer/character/factor indicating the study ID of the reference.
title character indicating the title of the reference.
abstract character indicating the abstract of the reference.
question character indicating the final question sent to OpenAI's GPT API models for training.

See Also

save_fine_tune_data()

Examples

# Extract 5 irrelevant and relevant records, respectively.
dat <- filges2015_dat[c(1:5, 261:265),]

prompt <- "Is this study about functional family therapy?"

dat <-
  create_fine_tune_data(
    data = dat,
    prompt = prompt,
    studyid = studyid,
    title = title,
    abstract = abstract
   )

dat


AIscreenR documentation built on Aug. 18, 2025, 5:15 p.m.