Lesson 2 Project: Translator

Language is pretty important. If none of us had a common language, we couldn't do things like text each other or talk to each other. You wouldn't even be able to understand this very paragraph. So what better way to improve your language use than by asking Deepseek to speak another language for you?

We will be utilizing the following topics:

  • The Deepseek API
  • Prompt Roles

Instructions

The Prompt

In this project, we want to make a program that if the user enters in a piece of text in English (or really, any language), then Deepseek should send back a translated version of that text in a different language.

Come up with a prompt to DeepSeek where you explicitly specify the input and output language. We will keep this intentionally vague so you can play around with the prompt. You can use the Deepseek website to test it out.

The Program

We want to create a program that does the following:

  1. Come up with 2 languages that you will let the user input. For example, Spanish and English. Let the user pick which one on startup.
  2. Let the user enter in their desired sentence.
  3. Come up with 3 languages that Deepseek will translate the user's text into. The language does not matter, but you should put in your native language so that you can check if it's actually translating it right.
  4. Use the Deepseek API code with the system prompt you made to generate the translated text.
  5. Show the user the translated text and ask them if they want to go again.

How to Use

Here's an example on how the program should look:

Extend Your Project

  1. Add more more languages to output.
  2. Do you think it's possible that the program doesn't need to ask the user for an input language? How would you go about doing this?
  3. You could turn this into a game of sorts, where Deepseek will show you a translated piece of text and the user has to enter their guess for what the original text was.