AI Classification - the modern if/else statement

Classification (binary and multi-class) models are the new if/else statements of the 21st century. Creating high-accuracy classification models quickly and cost-effectively will expedite the creation of AI-powered applications, pushing organizations forward into a new era.

Importance of Conditional Logic

Conditional logic (if/else/switch statements) is the foundational component of all software applications. They make apps run and allow us to integrate business logic into source code. Historically, conditional logic was a pre-defined - if/else or switch case. Today, we can expand conditional logic to include components of natural language.

Integrating AI Conditional Logic into Applications

Integrating AI conditional logic into applications has historically been done using the following ML technology:

  • gradient boosting models
  • neural network models
  • random forest
  • and many, many more

These models took time to collect data and build. They could also have been expensive to run. Due to costs, a business case was often required to identify why a classification model was required. LLMs have reduced the time it takes to build classification models - they can now be integrated everywhere.

Today, we can classify words, sentences, paragraphs, source code, and other text-based data using LLMs. Building and integrating an initial prompt can take as little as 2 minutes and add intelligence to an otherwise ordinary application. Adding many different AI-powered conditional/logical statements can make an application very intelligent.

3 simple examples

In this example, we will determine whether the text is positive - or not. Historically, this would have required classification model integration.

is_positive = pd.generate('is_positive', {
  'text': sample_text
}, classification=True)

if is_positive:
  #then do this
else:
  #then do that

In this example, we will determine whether someone is rude or not on Twitter (X).

is_rude = pd.generate('is_rude', {
  'tweet': tweet_text
}, classification=True)

if is_rude:
  #then do this
else:
  #then do that

In this example, we will determine whether a news article is relevant to a tweet.

is_relevant = pd.generate('is_relevant', {
  'tweet': tweet_text,
  'article': article_text
}, classification=True)

if is_relevant:
  #then do this
else:
  #then do that
Justin Macorin | LinkedIn
Lead Machine Learning Engineer, Seismic

Justin is a Lead Machine Learning Engineer with Seismic, the leading global sales enablement platform. His mission is to help accelerate the adoption of AI and help engineers accelerate their development of prompt-based applications.