< Back to examples

Contract Entity Extraction

Use generative models to easily parse out entities from text

Input

Extract the band name from the contract:

This Music Recording Agreement ("Agreement") is made effective as of the 13 day of December, 2021 by and between Good Kid, a Toronto-based musical group (“Artist”) and Universal Music Group, a record label with license number 545345 (“Recording Label"). Artist and Recording Label may each be referred to in this Agreement individually as a "Party" and collectively as the "Parties." Work under this Agreement shall begin on March 15, 2022.

Sample Response

Good Kid

API Request

1import cohere
2co = cohere.Client('{apiKey}')
3response = co.generate(
4  model='command',
5  prompt='extract the band name from the contract: This Music Recording Agreement (\"Agreement\") is made effective as of the 13 day of December, 2021 by and between Good Kid, a Toronto-based musical group (“Artist”) and Universal Music Group, a record label with license number 545345 (“Recording Label\"). Artist and Recording Label may each be referred to in this Agreement individually as a \"Party\" and collectively as the \"Parties.\" Work under this Agreement shall begin on March 15, 2022.',
6  max_tokens=200,
7  temperature=0.9,
8  k=0,
9  p=1,
10  frequency_penalty=0,
11  presence_penalty=0,
12  stop_sequences=[],
13  return_likelihoods='NONE')
14print('Prediction: {}'.format(response.generations[0].text))

Parameters

model_sizecommand
k 0
frequency_penalty 0
p 1
presence_penalty 0
max_tokens 200
temperature 0.9