Spam Detection

Given email titles, identify if the email is spam or not spam

Classify Data
Topic Classification

Examples

LABEL

TEXT

Spam

Dermatologists don't like her!

Spam

Hello, open to this?

Spam

I need help please wire me $1000 right now

Spam

Hot new investment, don’t miss this!

Spam

Nice to know you ;)

Spam

Please help me?

Not Spam

Your parcel will be delivered today

Not Spam

Review changes to our Terms and Conditions

Not Spam

Weekly sync notes

Not Spam

Re: Follow up from today’s meeting

Not Spam

Pre-read for tomorrow

Request

Confirm your email address

Response

Not Spam

76%

Spam

24%

API Request
import cohere
from cohere.classify import Example
co = cohere.Client('{apiKey}')
response = co.classify(
model='large',
inputs=["Confirm your email address", "hey i need u to send some $"],
examples=[Example("Dermatologists don\'t like her!", "Spam"), Example("Hello, open to this?", "Spam"), Example("I need help please wire me $1000 right now", "Spam"), Example("Hot new investment, don’t miss this!", "Spam"), Example("Nice to know you ;)", "Spam"), Example("Please help me?", "Spam"), Example("Your parcel will be delivered today", "Not spam"), Example("Review changes to our Terms and Conditions", "Not spam"), Example("Weekly sync notes", "Not spam"), Example("Re: Follow up from today’s meeting", "Not spam"), Example("Pre-read for tomorrow", "Not spam")])
print('The confidence levels of the labels are: {}'.format(response.classifications))