json_extract()
function extracts values from the JSON data passed as its argument.
To show how it works, we use the home rentals example. The model returns the predicted value and the explanation of the prediction in the form of JSON data.
confidence
value only, we can use the json_extract()
function as below.
gpt-3.5-turbo
model by default. But you can use the gpt-4
model as well by passing it to the model-name
parameter.engine
parameter ensures we use the OpenAI engine.json_struct
parameter stores a predefined JSON structure used for the output.input_text
parameter contains the name of the column that stores input text.sentence
column.