Translating text with just a few lines of code using Azure Cognitive Services
Tags: pythonbites, azure, python, ai
Published: 2020-11-19 21:44:22

---
title: Translating text with just a few lines of code using Azure Cognitive Services
published: true
description: 
tags: 
- pythonbites
- azure
- python
- ai
cover_image: https://github.com/trallard/python-fun-bites/blob/main/assets/python-bites-banner.png?raw=true
series: Python Fun Bites - All things Python at Microsoft # keep this to ensure all the posts are in the series
---
This article is part of [#PythonFunBites](http://aka.ms/PythonFunBites).

An old co-worker of mine is fond of saying "we're not launching rockets here". The point he was trying to highlight is whatever it is we're doing someone else (and probably somebody much smarter) has already created a solution. I've found this holds true, even in complex spaces like artificial intelligence.

When we think about some of the problems one would hope to solve with AI we find they're relatively common; there are a lot of people trying to do the same thing. Image recognition. Speech to text. Anomaly detection. All challenges lots of people are looking to AI to resolve.

So, if there are others doing it, why build something by ourselves? There certainly are instances where a custom model and implementation will be called for. But quite frequently we can use a service created by someone else, someone smarter than we are, whose sole job is to create the best solution possible for the one specific problem.

This is where [Azure Cognitive Services](https://docs.microsoft.com/learn/modules/create-manage-cognitive-services/?WT.mc_id=python-10852-chrhar) comes into play. Azure Cognitive Services is a collection of callable AI services which can be incorporated into any application. You can call the services by using SDKs in various languages, or even through REST calls.

I think a great service to start with is text translation, partly because there's only a handful of lines of code, but also because it's just fun to play with!. I created a video to highlight the service, and how to get started.

{% youtube 6VXuxIBqV94 %}

To use the service you will need an Azure account. Fortunately, if you're using a service like Text Translation, there's a free tier! (Yes, you read that right - free!) I always like to mention if you're a student [Azure for Students](https://aka.ms/a4s) you can access a bunch of free services and resources as well. You'll notice if you decide to go even further into development you could start to create [Unity applications which include translation services](https://docs.microsoft.com/learn/modules/create-language-translator-mixed-reality-application-unity-azure-cognitive-services?WT.mc_id=python-10852-chrhar).

But text translation is really only the start. There are [dozens of services available](https://docs.microsoft.com/azure/cognitive-services?WT.mc_id=python-10852-chrhar) for you to play with, almost all of them with a free tier. And the best way to learn is to get in and start playing!

Watch for content on all things Python at Microsoft between the 16th and 20th of November. Stay tuned here at dev.to for all kinds of content ranging from IoT, to Machine Learning and much more! 🐍