Article Title Classifier

Given an article title, identify if the article is about business news, cooking, or arts & culture

Classify Data
Topic Classification

Examples

LABEL

TEXT

Business news

Elon Musk says Twitter Blue subscribers should be able to pay with dogecoin

Business news

Probability of a US recession in the next 12 months, via WSJ

Business news

European futures slide

Business news

NASDAQ rises 2% to ATH

Business news

FTX Founder is one of the world's richest crypto billionaires, with a fortune valued at $20 billion.

Cooking

Sweet Potato Macaroni Cheese is #RecipeOfTheDay, and I’m very happy about it!

Cooking

3-Ingredient Slow Cooker recipes

Cooking

This is by far the BEST biscuit recipe I’ve ever tried

Cooking

Baking my first loaf of banana bread...

Cooking

From the queen of Italian cooking, this is one of the most iconic tomato sauce recipes ever

Arts & Culture

I’ve actually read this book and it was extremely insightful. A quick read as well and available as a free audiobook through many libraries.

Arts & Culture

Today’s Daily Cartoon

Arts & Culture

Get a glimpse of the stage adaptation of Hayao Miyazaki’s 2001 Oscar-winning animated feature Spirited Away

Arts & Culture

The #Banksy Exhibit in Cambridge, MA is absolutely terrific.

Arts & Culture

“A Whisper in Time” large abstract paining 48’ x 48’

Request

Any decent trader spends 90% of their efforts exploring how they could be wrong. That should apply to everyone’s decision making.

Response

Business news

89%

Arts & Culture

7%

Cooking

4%

API Request
import cohere
from cohere.classify import Example
co = cohere.Client('{apiKey}')
response = co.classify(
model='large',
inputs=["Any decent trader spends 90% of their efforts exploring how they could be wrong. That should apply to everyone’s decision making."],
examples=[Example("Elon Musk says Twitter Blue subscribers should be able to pay with dogecoin", "Business news"), Example("Probability of a US recession in the next 12 months, via WSJ", "Business news"), Example("European futures slide", "Business news"), Example("NASDAQ rises 2% to ATH", "Business news"), Example("FTX Founder is one of the world\'s richest crypto billionaires, with a fortune valued at $20 billion.", "Business news"), Example("Sweet Potato Macaroni Cheese is #RecipeOfTheDay, and I’m very happy about it!", "Cooking"), Example("3-Ingredient Slow Cooker recipes", "Cooking"), Example("This is by far the BEST biscuit recipe I’ve ever tried", "Cooking"), Example("Baking my first loaf of banana bread...", "Cooking"), Example("From the queen of Italian cooking, this is one of the most iconic tomato sauce recipes ever", "Cooking"), Example("I’ve actually read this book and it was extremely insightful. A quick read as well and available as a free audiobook through many libraries.", "Arts & Culture"), Example("Today’s Daily Cartoon", "Arts & Culture"), Example("Get a glimpse of the stage adaptation of Hayao Miyazaki’s 2001 Oscar-winning animated feature Spirited Away", "Arts & Culture"), Example("The #Banksy Exhibit in Cambridge, MA is absolutely terrific.", "Arts & Culture"), Example("“A Whisper in Time” large abstract paining 48’ x 48’", "Arts & Culture")])
print('The confidence levels of the labels are: {}'.format(response.classifications))