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-2-2.RData")
  1. The queries
Beta22Call <- stream_in(file("rbeta-2-2-Call-Revised-0409.jsonl"))
opening file input connection.

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

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

Merge the call and the result

Beta.2.2.OpenAI <- left_join(Beta22Call,Beta22Result)
Joining with `by = join_by(custom_id)`
Full.Beta.2.2.0409 <- left_join(Beta22$params, Beta.2.2.OpenAI)
Joining with `by = join_by(custom_id)`

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

Put the result in the params file.

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

       Beta Exponential      Normal     Uniform 
        494           1           2           3 
save(Full.Beta.2.2.0409, file="Full.Beta.2.2.0409.RData")