Beta-Results-Processor

I will begin by loading three things.

  1. the data that were stored from creating the batch file.
library(jsonlite)
library(tidyverse)
load("rbeta-5-2.RData")
  1. The queries
Beta52Call <- stream_in(file("rbeta-5-2-Call-Revised.jsonl"))
opening file input connection.

 Found 500 records...
 Imported 500 records. Simplifying...
closing file input connection.
  1. The Results
Beta52Result <- stream_in(file("rbeta-5-2_output.jsonl"))
opening file input connection.

 Found 500 records...
 Imported 500 records. Simplifying...
closing file input connection.

Merge the call and the result

Beta.5.2.OpenAI <- left_join(Beta52Call,Beta52Result)
Joining with `by = join_by(custom_id)`
Full.Beta.5.2 <- left_join(Beta52$params, Beta.5.2.OpenAI)
Joining with `by = join_by(custom_id)`

The file is saved as Full.Beta.5.2.RData.

Put the result in the params file.

Full.Beta.5.2$Outcome <- map_chr(Beta52$params$iter, function(x) { unlist(Beta52Result$response$body$choices[[x]][[2]][2]) })
table(Full.Beta.5.2$Outcome)

  Beta Normal 
     1    499 
save(Full.Beta.5.2, file="Full.Beta.5.2.RData")