Replicating sentiment analysis output I got from ChatGPT through now use of API

Hi, I’m working on extracting sentiment/action items from unstructured text (comments), which is in a JSON file.

I could upload the json file to ChatGPT & ask it to give me top 5 sentiments (with certain factors that I’d ask it consider). It would parse the JSON file & would give me the top 5 sentiments with a describing sentence or two - including how much support each sentiment had.

However, to scale up, I need to automate the process. So I figured I’d use the OpenAI API. Since I need to classify the comments (positive/negative) & cluster them together (to gauge priority), the ‘Embeddings’ capability fit for my use case.

However, the Embeddings API response is numbers instead of text like I used to get from ChatGPT.

How can I get the kind of output I used to get in the ChatGPT terminal through the use of APIs?

Thanks in advance!

You can try the GPT for sheets addon on Google Sheets if you want a no-code solution.

You can first classify the comments and then create a graph.

You can also add classifications like product-related complaints, Service-related complaints, etc.

You can tell ChatGPT to convert the JSON to CSV to import it into Google Sheets easily.

Is there a more straightforward way (one that doesn’t require knowledge of graphs and embeddings) that can have OpenAI API parse through the JSON file and give me the output. Just how I could upload the JSON to ChatGPT & it would the parse the JSON to give me the output?