< Back to examples

Article Title Classifier

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

Examples

  • Business news
    • Elon Musk says Twitter Blue subscribers should be able to pay with dogecoin
    • Probability of a US recession in the next 12 months, via WSJ
    • European futures slide
    • NASDAQ rises 2% to ATH
    • 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!
    • 3-Ingredient Slow Cooker recipes
    • This is by far the BEST biscuit recipe I’ve ever tried
    • Baking my first loaf of banana bread...
    • 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.
    • Today’s Daily Cartoon
    • Get a glimpse of the stage adaptation of Hayao Miyazaki’s 2001 Oscar-winning animated feature Spirited Away
    • The #Banksy Exhibit in Cambridge, MA is absolutely terrific.
    • “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.

Value

Confidence level

Business news

89%

API Request

1import cohere
2from cohere.classify import Example
3co = cohere.Client('{apiKey}')
4response = co.classify(
5  model='embed-english-v2.0',
6  inputs=["Any decent trader spends 90% of their efforts exploring how they could be wrong. That should apply to everyone’s decision making."],
7  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")])
8print('The confidence levels of the labels are: {}'.format(response.classifications))