Machine Learning

Machine Learning + openAI: solving the text classification problem | by Ricardo Ribas

How I migrated an old solution to a better, more robust and scalable solution using text segmentation from openAI

About Data Science
Photo by Hunter Harritt on Unsplash

As mentioned in the previous article, I talked about how I learned the basics of machine learning to solve the problem of text classification. Due to the lack of experience in machine learning and AI, it was very important to be pragmatic and find a solution that would:

  1. Easy to use and maintain;
  2. It's not expensive;
  3. Compatible with existing solutions;
  4. Quickly edit large amounts of text;
  5. Ability to constantly improve and refine;

From the research carried out, OpenAI appeared initially to be the best fit for the solution needs.

With just a few lines, you can make a request to the openAI api to get a classification response. For the sake of demonstration, I used an example from the examples directory.

import OpenAI from "openai";

// Initialize the openai api key
const openai = new OpenAI({
apiKey: 'OPEN-AI-API-KEY'
});

const response =…

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button