Spacy-Powered Translator with Streamlit
I’m sure that on more than one occasion you have used a translator such as Google Translate or Deepl. These tools allow us to translate any text from one language to another in a fast and easy way.
The problem is when you like to learn languages, you are beginning to understand what each word means, how the sentences are structured and translating the text directly does not help much.
To solve these problems, I have created my own translator thanks to Spacy and Streamlit.
Added features to the translator
I have done something very simple but very helpful for learning languages. I have added that the text to be translated and the translated text appear with the words colored according to their syntactic function.
What does this solve for me?
Thanks to this I can identify the relationship between the words in the text to be translated and the translated text, and I can also see how sentences are structured in one language and the other.
This helps a lot when you learn a language that has a very different grammatical structure from your own.
There are languages that have an S (subject) + V (verb) + O (object) structure. Other languages have the structure S + O + V and so on.
This way, when translating a text you can save yourself from translating individual words because you do not know the correspondence between the word to be translated and the translated word.
How I developed the translator
As an example I made a translator that translates from English to Spanish, but it could be done with any language.
Thanks to Spacy I identify the syntactic function of each word. Streamlit helps me to have the interface
I leave you a video where you can see the whole process.