How I migrated an old solution to a more elegant, robust and scalable solution using openAI text classification
As mentioned in the previous articleI talked about how I learned the fundamentals of machine learning so I could solve a text classification problem. Due to the lack of experience with machine learning and ai, it was very important to be pragmatic and find a solution that was:
- Easy to use and maintain;
- It is not expensive;
- Compatible with existing solutions;
- Quickly classify large amounts of text;
- Ability to be constantly improved and perfected;
From the research carried out, Open ai At first glance it seemed like the one that would fit the requirements of the solution.
With just a few lines, you can make a request to the openAI API to get a ranking response. For the demonstration, I used an example of examples reference.
import OpenAI from "openai";// Initialize the openai api key
const openai = new OpenAI({
apiKey: 'OPEN-ai-API-KEY'
});
const response =…