<jupyter_start><jupyter_text>![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/nlu/blob/master/examples/colab/component_examples/sequence2sequence/translation_demo.ipynb)   Translate between more than 200 Languages in 1 line of code with the [Marian Models](https://marian-nmt.github.io/publications/) Marian is an efficient, free Neural Machine Translation framework mainly being developed by the Microsoft Translator team (646+ pretrained models & pipelines in 192+ languages)You need to specify the language your data is in as `start_language` and the language you want to translate to as `target_language`.     The language references must be [ISO language codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)`nlu.load('.translate.')`       **Translate Turkish to English:**     `nlu.load('tr.translate_to.fr')`**Translate English to French:**     `nlu.load('en.translate_to.fr')`**Translate French to Hebrew:**     `nlu.load('fr.translate_to.he')`<jupyter_code>!wget https://setup.johnsnowlabs.com/nlu/colab.sh -O - | bash
  

import nlu
# Download bitcoin newsarticles
import pandas as pd
!wget http://ckl-it.de/wp-content/uploads/2020/12/small_btc.csv 
df = pd.read_csv('/content/small_btc.csv')<jupyter_output>--2021-05-01 23:03:01--  http://ckl-it.de/wp-content/uploads/2020/12/small_btc.csv
Resolving ckl-it.de (ckl-it.de)... 192.168.127.12, fc00:db20:35b:7399::5
Connecting to ckl-it.de (ckl-it.de)|192.168.127.12|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22244914 (21M) [text/csv]
Saving to: ‘small_btc.csv’

small_btc.csv       100%[===================>]  21.21M  4.86MB/s    in 5.1s    

2021-05-01 23:03:06 (4.14 MB/s) - ‘small_btc.csv’ saved [22244914/22244914]<jupyter_text>Translate English movie Titles to German<jupyter_code>translate_pipe = nlu.load('en.translate_to.de')
de_df = translate_pipe.predict(df.title.iloc[:10])
de_df<jupyter_output>translate_en_de download started this may take some time.
Approx size to download 370.2 MB
[OK!]<jupyter_text>Translate English to French<jupyter_code>translate_pipe = nlu.load('en.translate_to.fr')
tr_df = translate_pipe.predict(df.title.iloc[:10])
tr_df<jupyter_output>translate_en_fr download started this may take some time.
Approx size to download 376 MB
[OK!]<jupyter_text>Translate English to Hebrew<jupyter_code>translate_pipe = nlu.load('en.translate_to.he')
tr_df = translate_pipe.predict(df.title.iloc[:10])
tr_df<jupyter_output>translate_en_he download started this may take some time.
Approx size to download 399.3 MB
[OK!]
{'fraction_non_alphanumeric': 0.13866171003717473, 'fraction_numerical': 0.056133828996282525, 'mean_word_length': 5.331764705882353, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '49107', 'license': 'Apache-2.0', 'n_tokens_mistral': 1069, 'n_tokens_neox': 951, 'n_words': 204, 'path': 'nlu/colab/component_examples/sequence2sequence/translation_demo.ipynb', 'repo_name': 'iamvarol/spark-nlp-workshop', 'size': '2690'}