![]() origin: Original text, that is ‘ Cerco un centro di gravità permanente‘ in our example.dest: Destination language, which is set to English (en).src: The source language, which is set to Italin (it).The object returned by the translate() method has the following attributes: I am seeking a permanent center of gravity my_translation = anslate("Cerco un centro di gravità permanente", src='it', dest='en') Let’s say that we want to translate the above “Italian” sentence to “English”. In our example, we will define the source and the destination language. The translate function translates from source language to destination language taking as default “English” as destination language and as a source language it tries to detect the language. How to translate from source language to destination language # find the code for english, french, italian, spanish and greek Let’s say that we want to get the code of specific languages, like ‘ English‘, ‘ Italian‘, ‘ Spanish‘, ‘ French‘, and ‘ Greek‘. ![]() Lang_df = pd.om_dict(googletrans.LANGUAGES, orient='index', columns=) # how to get the supported language and their corresponing code Below, we give an example of how you can get the supported language and their corresponding code: import pandas as pd ![]() Google Translate supports more than 100 languages. I suggest to use the conda install command. The first thing that we need to do is to install the googletrans library. This uses the Google Translate Ajax API to make calls to such methods as detect and translate. ![]() Today, we will provide examples of how we can use the googletrans which is a free and unlimited python library that implemented Google Translate API. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |