Bilingual translation output

Hello, I hope you’re having a good day.
I want to create a prompt for ChatGPT to receive a message from the user and translate that message into English.

However, I want to provide a bilingual output where the translation of each sentence is written below the original sentence.

Input:
En marzo de 1999, la empresa trasladó sus oficinas a Palo Alto, California, que alberga varias empresas emergentes de tecnología prominentes de Silicon Valley.

Al año siguiente, Google comenzó a vender anuncios asociados con palabras clave de búsqueda en contra de la oposición inicial de Page y Brin hacia un motor de búsqueda financiado con publicidad.

Output:

Sentence:
En marzo de 1999, la empresa trasladó sus oficinas a Palo Alto, California, que alberga varias empresas emergentes de tecnología prominentes de Silicon Valley.
Translation:
In March 1999, the company moved its offices to Palo Alto, California, which is home to several prominent Silicon Valley technology start-ups.

Sentence:
Al año siguiente, Google comenzó a vender anuncios asociados con palabras clave de búsqueda en contra de la oposición inicial de Page y Brin hacia un motor de búsqueda financiado con publicidad.
Translation:
The next year, Google began selling advertisements associated with search keywords against Page and Brin’s initial opposition toward an advertising-funded search engine.

Do you have a solution for obtaining this output?

I would try a one-shot example in the prompt if you can’t find prompt wording to get it done.

What have you tried so far?

2 Likes

Thank you, You’re right, providing a one-shot example in the prompt is a good idea.

But I came and did it and finally got an answer. Do you confirm this prompt worked well? Thank you, your opinion is important to me.

Prompt: "Here is a prompt to get ChatGPT to provide sentence-by-sentence bilingual output:"

1 Like

You can simply use your question and example as the prompt (with a slight modification).
The solution below works with GPT-4 (T=0) & (ChatGPT-pro) every time and with GPT-3.5 (T=0) & Chat GPT (free version) 99% of the time.

Prompt:

I want to receive a message from the user and translate that message into English.

However, I want to provide a bilingual output where the translation of each sentence is written below the original sentence.

Example 1:
Input:
Sentence 1.
En marzo de 1999, la empresa trasladó sus oficinas a Palo Alto, California, que alberga varias empresas emergentes de tecnología prominentes de Silicon Valley.

Sentence 2.
Al año siguiente, Google comenzó a vender anuncios asociados con palabras clave de búsqueda en contra de la oposición inicial de Page y Brin hacia un motor de búsqueda financiado con publicidad.

Output:

Sentence 1:
En marzo de 1999, la empresa trasladó sus oficinas a Palo Alto, California, que alberga varias empresas emergentes de tecnología prominentes de Silicon Valley.
Translation:
In March 1999, the company moved its offices to Palo Alto, California, which is home to several prominent Silicon Valley technology start-ups.

Sentence 2:
Al año siguiente, Google comenzó a vender anuncios asociados con palabras clave de búsqueda en contra de la oposición inicial de Page y Brin hacia un motor de búsqueda financiado con publicidad.
Translation:
The next year, Google began selling advertisements associated with search keywords against Page and Brin’s initial opposition toward an advertising-funded search engine.

Example 2:

Input:
Sentence 1.
(Your input sentence 1 goes here).

Sentence 2.
(Your input sentence 2 goes here).

Output:

3 Likes

Great job champ!

GPT-3.5 does need very verbose instructions, think of it as a 4 year old child with extraordinary linguistic skills :laughing:

I re-wrote your prompt a bit and found something that does what you want:

translate user input from spanish to english using the formatting as delimited # make sure to use both languages when addressing the user. Request input if none is given.


### example 
user: Hola, me llamo Juan y estoy aprendiendo español porque me gusta la idea de hablar otro idioma. Además, tengo hambre, ¿sabes dónde puedo comprar una manzana roja?

Assistant:
**Spanish:** Hola.
**English:** Hello.

**Spanish:** Me llamo Juan.
**English:** My name is Juan.

**Spanish:** Estoy aprendiendo español.
**English:** I am learning Spanish.

**Spanish:** Porque me gusta la idea de hablar otro idioma.
**English:** Because I like the idea of speaking another language.

**Spanish:** Además, tengo hambre.
**English:** Also, I am hungry.

**Spanish:** ¿Sabes dónde puedo comprar una manzana roja?
**English:** Do you know where I can buy a red apple?
###
STOP

The output to your original input sentence looks like this:

Here’s a link to the conversation so you can play with it yourself:

https://chat.openai.com/share/bfc0eeb4-4b2f-4d82-a6a6-ddecb431a339

I hope that helps :heart:

1 Like

I wanted to take a moment to express my sincere gratitude for the solution you provided. Your assistance was incredibly valuable, and I am pleased to inform you that the solution you offered was indeed correct.

Your guidance helped me achieve the desired outcome smoothly. Your explanation was clear and easy to understand, which made the implementation process a breeze. I truly appreciate the effort you put into addressing my query. :pray:

1 Like

I wanted to drop you a quick note to express my heartfelt appreciation for the solution you provided. Your creativity and insight truly shine through in your approach, and I must say, “Great job, champ!” :star_struck: :hugs:

I must commend you on reworking the prompt to meet my requirements perfectly. The example you’ve shared exemplifies precisely what I was aiming for, and your inclusion of both languages when addressing the user is a thoughtful touch.

2 Likes

You’re welcome, always happy help!

GPT does write a good thank you note :wink:

3 Likes