Email Keyword Extraction

Extract product name and return address from an email

Generate Content
Extraction

Input

Extract the product and return address from this email:

Dear Elliott,

Unfortunately, your item, Supreme The North Face Statue of Liberty Baltoro Jacket, was not accepted for verification.
We will be shipping this back to 171 John Street, Toronto ON, M5T 1X2.

Product:

Response

Supreme The North Face Statue of Liberty Baltoro Jacket
Address: 171 John Street, Toronto ON, M5T 1X2

API Request
import cohere
co = cohere.Client('{apiKey}')
response = co.generate(
model='command-xlarge-20221108',
prompt='Extract the product and return address from this email:\n\nDear Elliott, \n\nUnfortunately, your item, Supreme The North Face Statue of Liberty Baltoro Jacket, was not accepted for verification. \nWe will be shipping this back to 171 John Street, Toronto ON, M5T 1X2. \n\nProduct:',
max_tokens=40,
temperature=0.4,
k=0,
p=1,
frequency_penalty=0,
presence_penalty=0,
stop_sequences=[],
return_likelihoods='NONE')
print('Prediction: {}'.format(response.generations[0].text))

Parameters

model_sizecommand xlarge
frequency_penalty0
k0
max_tokens40
p1
presence_penalty0
temperature0.4