< Back to examples

Correct Errors in Voice to Text

Correct all the grammatical errors within an excerpt of a transcript

Input

This is voice-to-text transcription corrector. Given a transcribed excerpt with errors, the model responds with the correct version of the excerpt.

Incorrect transcription: I am balling into hay to read port missing credit card. I lost by card when I what's at the grocery store and I need to see sent a new one.

Correct transcription: I am calling in today to report a missing credit card. I lost my card when I was at the grocery store and I need to be sent a new one.

--

Incorrect transcription: Can you repeat the dates for the three and five dear fixed mortgages? I want to compare them a gain the dates I was quoted by a other broker.

Correct transcription: Can you repeat the rates for the three and five year fixed mortgages? I want to compare them against the rates I was quoted by another broker.

--

Incorrect transcription: I got got charged interest on ly credit card but I paid my pull balance one day due date. I not missed a pavement year yet. Man you reverse the interest charge?

Correct transcription:

Sample Response

I got charged interest on my credit card but I paid my full balance one day before the due date. I have not missed a payment yet. Can you reverse the interest charge?

API Request

1import cohere
2co = cohere.Client('{apiKey}')
3response = co.generate(
4  model='base',
5  prompt='This is voice-to-text transcription corrector. Given a transcribed excerpt with errors, the model responds with the correct version of the excerpt.\n\nIncorrect transcription: I am balling into hay to read port missing credit card. I lost by card when I what\'s at the grocery store and I need to see sent a new one.\n\nCorrect transcription: I am calling in today to report a missing credit card. I lost my card when I was at the grocery store and I need to be sent a new one.\n--\nIncorrect transcription: Can you repeat the dates for the three and five dear fixed mortgages? I want to compare them a gain the dates I was quoted by a other broker.\n\nCorrect transcription: Can you repeat the rates for the three and five year fixed mortgages? I want to compare them against the rates I was quoted by another broker.\n--\nIncorrect transcription: I got got charged interest on ly credit card but I paid my pull balance one day due date. I not missed a pavement year yet. Man you reverse the interest charge?\n\nCorrect transcription:',
6  max_tokens=40,
7  temperature=0.5,
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_sizebase
stop_sequence --
max_tokens 40
temperature 0.5
k 0
frequency_penalty 0
p 1
presence_penalty 0