{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "2_multilingual_translation_and_othr_stuff_with_marian.ipynb", "provenance": [], "collapsed_sections": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "5hueV5WBrCzf" }, "source": [ "![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)\n", "\n", "\n", "\n", "[![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)\n", "\n", " \n", " # Translate between more than 300 Languages in 1 line of code with the [Marian Models](https://marian-nmt.github.io/publications/)\n", "\n", " Marian is an efficient, free Neural Machine Translation framework mainly being developed by the Microsoft Translator team (646+ pretrained models & pipelines in 192+ languages)\n", "You need to specify the language your data is in as `start_language` and the language you want to translate to as `target_language`. \n", " The language references must be [ISO language codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)\n", "\n", "`nlu.load('.translate.')` \n", "\n", "**Translate Turkish to English:** \n", "`nlu.load('tr.translate_to.en')`\n", "\n", "**Translate English to French:** \n", "`nlu.load('en.translate_to.fr')`\n", "\n", "\n", "**Translate French to Hebrew:** \n", "`nlu.load('en.translate_to.he')`\n" ] }, { "cell_type": "code", "metadata": { "id": "abuB9K1_QVuL", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "eb79ac35-ca02-4ee0-e948-966e45088985" }, "source": [ "import os\n", "! apt-get update -qq > /dev/null \n", "# Install java\n", "! apt-get install -y openjdk-8-jdk-headless -qq > /dev/null\n", "os.environ[\"JAVA_HOME\"] = \"/usr/lib/jvm/java-8-openjdk-amd64\"\n", "os.environ[\"PATH\"] = os.environ[\"JAVA_HOME\"] + \"/bin:\" + os.environ[\"PATH\"]\n", "! pip install nlu pyspark==2.4.7 > /dev/null \n", "import nlu\n" ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ "Collecting nlu\n", "\u001b[?25l Downloading https://files.pythonhosted.org/packages/7e/6c/e5d13cdf2e06d7b29aa8ecf50ad182d25a0ef9376f47e729960b09cd53d2/nlu-1.1.1-py3-none-any.whl (158kB)\n", "\u001b[K |████████████████████████████████| 163kB 4.2MB/s \n", "\u001b[?25hCollecting pyspark==2.4.7\n", "\u001b[?25l Downloading https://files.pythonhosted.org/packages/e2/06/29f80e5a464033432eedf89924e7aa6ebbc47ce4dcd956853a73627f2c07/pyspark-2.4.7.tar.gz (217.9MB)\n", "\u001b[K |████████████████████████████████| 217.9MB 67kB/s \n", "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from nlu) (1.19.5)\n", "Requirement already satisfied: dataclasses in /usr/local/lib/python3.6/dist-packages (from nlu) (0.8)\n", "Requirement already satisfied: pandas in /usr/local/lib/python3.6/dist-packages (from nlu) (1.1.5)\n", "Collecting pyarrow>=0.16.0\n", "\u001b[?25l Downloading https://files.pythonhosted.org/packages/33/67/2f4fcce1b41bcc7e88a6bfdb42046597ae72e5bc95c2789b7c5ac893c433/pyarrow-3.0.0-cp36-cp36m-manylinux2014_x86_64.whl (20.7MB)\n", "\u001b[K |████████████████████████████████| 20.7MB 1.4MB/s \n", "\u001b[?25hCollecting spark-nlp<2.8,>=2.7.1\n", "\u001b[?25l Downloading https://files.pythonhosted.org/packages/32/9e/2f43d668eefea486e7417c1e83554c72a41e0786976e9429846b753f5014/spark_nlp-2.7.3-py2.py3-none-any.whl (138kB)\n", "\u001b[K |████████████████████████████████| 143kB 41.3MB/s \n", "\u001b[?25hCollecting py4j==0.10.7\n", "\u001b[?25l Downloading https://files.pythonhosted.org/packages/e3/53/c737818eb9a7dc32a7cd4f1396e787bd94200c3997c72c1dbe028587bd76/py4j-0.10.7-py2.py3-none-any.whl (197kB)\n", "\u001b[K |████████████████████████████████| 204kB 55.5MB/s \n", "\u001b[?25hRequirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas->nlu) (2018.9)\n", "Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.6/dist-packages (from pandas->nlu) (2.8.1)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.6/dist-packages (from python-dateutil>=2.7.3->pandas->nlu) (1.15.0)\n", "Building wheels for collected packages: pyspark\n", " Building wheel for pyspark (setup.py) ... \u001b[?25l\u001b[?25hdone\n", " Created wheel for pyspark: filename=pyspark-2.4.7-py2.py3-none-any.whl size=218279465 sha256=71fc8754f32cbda4aac57e21f13941ded7cb7fbe4d0dda9bec994490d08df05f\n", " Stored in directory: /root/.cache/pip/wheels/34/1f/2e/1e7460f80acf26b08dbb8c53d7ff9e07146f2a68dd5c732be5\n", "Successfully built pyspark\n", "Installing collected packages: pyarrow, spark-nlp, nlu, py4j, pyspark\n", " Found existing installation: pyarrow 0.14.1\n", " Uninstalling pyarrow-0.14.1:\n", " Successfully uninstalled pyarrow-0.14.1\n", "Successfully installed nlu-1.1.1 py4j-0.10.7 pyarrow-3.0.0 pyspark-2.4.7 spark-nlp-2.7.3\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "5ugeWRVe0Pcc", "outputId": "e712fbd6-8a96-4ed7-c98a-ed42a4a736c0" }, "source": [ "# Download bitcoin newsarticles\n", "import pandas as pd\n", "!wget http://ckl-it.de/wp-content/uploads/2020/12/small_btc.csv \n", "df = pd.read_csv('/content/small_btc.csv').iloc[0:20].title" ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ "--2021-02-11 18:48:10-- http://ckl-it.de/wp-content/uploads/2020/12/small_btc.csv\n", "Resolving ckl-it.de (ckl-it.de)... 217.160.0.108, 2001:8d8:100f:f000::209\n", "Connecting to ckl-it.de (ckl-it.de)|217.160.0.108|:80... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 22244914 (21M) [text/csv]\n", "Saving to: ‘small_btc.csv’\n", "\n", "small_btc.csv 100%[===================>] 21.21M 6.54MB/s in 3.5s \n", "\n", "2021-02-11 18:48:14 (6.00 MB/s) - ‘small_btc.csv’ saved [22244914/22244914]\n", "\n" ], "name": "stdout" } ] }, { "cell_type": "markdown", "metadata": { "id": "xMnjlxA1V16o" }, "source": [ "# Translate English movie Titles to German" ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 833 }, "id": "ht0z7aiSVcIN", "outputId": "7235aa16-a5d8-4766-c8e4-64d98022edd1" }, "source": [ "import nlu\n", "translate_pipe = nlu.load('en.translate_to.de')\n", "de_df = translate_pipe.predict(df)\n", "de_df\n" ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ "translate_en_de download started this may take some time.\n", "Approx size to download 370.2 MB\n", "[OK!]\n" ], "name": "stdout" }, { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
texttranslationsentencetitle
origin_index
0Bitcoin Price Update: Will China Lead us Down?Bitcoin Price Update: Wird China uns nach unte...Bitcoin Price Update: Will China Lead us Down?Bitcoin Price Update: Will China Lead us Down?
1Key Bitcoin Price Levels for Week 51 (15 – 22 ...Preisniveaus für Bitcoin für Woche 51 (15.-22....Key Bitcoin Price Levels for Week 51 (15 – 22 ...Key Bitcoin Price Levels for Week 51 (15 – 22 ...
2National Australia Bank, Citing Highly Flawed ...Die National Australia Bank, die hochflawed Da...National Australia Bank, Citing Highly Flawed ...National Australia Bank, Citing Highly Flawed ...
3Chinese Bitcoin Ban Driven by Chinese Banking...Chinesische Bitcoin Ban durch chinesische Bank...Chinese Bitcoin Ban Driven by Chinese Banking...Chinese Bitcoin Ban Driven by Chinese Banking...
4Bitcoin Trade Update: Opened PositionBitcoin Trade Update: Geöffnete PositionBitcoin Trade Update: Opened PositionBitcoin Trade Update: Opened Position
5Key Bitcoin Price Levels for Week 52 (22 – 28 ...Key Bitcoin Price Levels für Woche 52 (22. - 2...Key Bitcoin Price Levels for Week 52 (22 – 28 ...Key Bitcoin Price Levels for Week 52 (22 – 28 ...
6Bitcoin SurvivalBitcoin ÜberlebenBitcoin SurvivalBitcoin Survival
7Massive Bitcoin Sell Going OnMassive Bitcoin verkaufen weiterMassive Bitcoin Sell Going OnMassive Bitcoin Sell Going On
8Why Bitcoin will rise on Monday 23rd by more t...Warum Bitcoin am Montag um mehr als 10% steige...Why Bitcoin will rise on Monday 23rd by more t...Why Bitcoin will rise on Monday 23rd by more t...
9Why Bitcoin is falling, and will rise againWarum Bitcoin fällt und wieder aufsteigtWhy Bitcoin is falling, and will rise againWhy Bitcoin is falling, and will rise again
10Bitcoin Price in 2014Bitcoin Preis 2014Bitcoin Price in 2014Bitcoin Price in 2014
11This is probably the best time to invest in Bi...Dies ist wahrscheinlich die beste Zeit, um in ...This is probably the best time to invest in Bi...This is probably the best time to invest in Bi...
12Comparing Bitcoins and OrangesVergleich von Bitcoins und OrangenComparing Bitcoins and OrangesComparing Bitcoins and Oranges
13Key Bitcoin Price Levels for the Week AheadDie wichtigsten Preisniveaus für Bitcoin für d...Key Bitcoin Price Levels for the Week AheadKey Bitcoin Price Levels for the Week Ahead
14The 2014 Bitcoin War Has Started— And it is Bo...Der Bitcoin-Krieg 2014 hat begonnen - Und es i...The 2014 Bitcoin War Has Started— And it is Bo...The 2014 Bitcoin War Has Started— And it is Bo...
15Two new Bitcoin ASIC Miners : Scam or Real?Zwei neue Bitcoin ASIC Miners: Scam oder Real?Two new Bitcoin ASIC Miners : Scam or Real?Two new Bitcoin ASIC Miners : Scam or Real?
16KnCMiner Announces 2TH/s Bitcoin ASIC MinerKnCMiner kündigt 2. Bitcoin ASIC Miner anKnCMiner Announces 2TH/s Bitcoin ASIC MinerKnCMiner Announces 2TH/s Bitcoin ASIC Miner
17PSA: Do Not Fall for the Apple Bitcoin Miner HoaxPSA: Fallen Sie nicht für den Apple Bitcoin Mi...PSA: Do Not Fall for the Apple Bitcoin Miner HoaxPSA: Do Not Fall for the Apple Bitcoin Miner Hoax
18Breaking News: HashCows Mining Pool HackedNachrichten:Breaking News:Breaking News: HashCows Mining Pool Hacked
18Breaking News: HashCows Mining Pool HackedHashCows Bergbau Pool gehacktHashCows Mining Pool HackedBreaking News: HashCows Mining Pool Hacked
19Primecoin Cloud Mining using Digital Ocean – T...Primecoin Cloud Mining mit Digital Ocean - Der...Primecoin Cloud Mining using Digital Ocean – T...Primecoin Cloud Mining using Digital Ocean – T...
\n", "
" ], "text/plain": [ " text ... title\n", "origin_index ... \n", "0 Bitcoin Price Update: Will China Lead us Down? ... Bitcoin Price Update: Will China Lead us Down?\n", "1 Key Bitcoin Price Levels for Week 51 (15 – 22 ... ... Key Bitcoin Price Levels for Week 51 (15 – 22 ...\n", "2 National Australia Bank, Citing Highly Flawed ... ... National Australia Bank, Citing Highly Flawed ...\n", "3 Chinese Bitcoin Ban Driven by Chinese Banking... ... Chinese Bitcoin Ban Driven by Chinese Banking...\n", "4 Bitcoin Trade Update: Opened Position ... Bitcoin Trade Update: Opened Position\n", "5 Key Bitcoin Price Levels for Week 52 (22 – 28 ... ... Key Bitcoin Price Levels for Week 52 (22 – 28 ...\n", "6 Bitcoin Survival ... Bitcoin Survival\n", "7 Massive Bitcoin Sell Going On ... Massive Bitcoin Sell Going On\n", "8 Why Bitcoin will rise on Monday 23rd by more t... ... Why Bitcoin will rise on Monday 23rd by more t...\n", "9 Why Bitcoin is falling, and will rise again ... Why Bitcoin is falling, and will rise again\n", "10 Bitcoin Price in 2014 ... Bitcoin Price in 2014\n", "11 This is probably the best time to invest in Bi... ... This is probably the best time to invest in Bi...\n", "12 Comparing Bitcoins and Oranges ... Comparing Bitcoins and Oranges\n", "13 Key Bitcoin Price Levels for the Week Ahead ... Key Bitcoin Price Levels for the Week Ahead\n", "14 The 2014 Bitcoin War Has Started— And it is Bo... ... The 2014 Bitcoin War Has Started— And it is Bo...\n", "15 Two new Bitcoin ASIC Miners : Scam or Real? ... Two new Bitcoin ASIC Miners : Scam or Real?\n", "16 KnCMiner Announces 2TH/s Bitcoin ASIC Miner ... KnCMiner Announces 2TH/s Bitcoin ASIC Miner\n", "17 PSA: Do Not Fall for the Apple Bitcoin Miner Hoax ... PSA: Do Not Fall for the Apple Bitcoin Miner Hoax\n", "18 Breaking News: HashCows Mining Pool Hacked ... Breaking News: HashCows Mining Pool Hacked\n", "18 Breaking News: HashCows Mining Pool Hacked ... Breaking News: HashCows Mining Pool Hacked\n", "19 Primecoin Cloud Mining using Digital Ocean – T... ... Primecoin Cloud Mining using Digital Ocean – T...\n", "\n", "[21 rows x 4 columns]" ] }, "metadata": { "tags": [] }, "execution_count": 3 } ] }, { "cell_type": "markdown", "metadata": { "id": "LbxlhONgD7ph" }, "source": [ "# Translate English to French" ] }, { "cell_type": "code", "metadata": { "id": "vvQ3UzDIhRz3", "colab": { "base_uri": "https://localhost:8080/", "height": 833 }, "outputId": "f5894fdf-f7db-40e7-b27c-da84a5852963" }, "source": [ "translate_pipe = nlu.load('en.translate_to.fr')\n", "tr_df = translate_pipe.predict(df)\n", "tr_df\n" ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ "translate_en_fr download started this may take some time.\n", "Approx size to download 376 MB\n", "[OK!]\n" ], "name": "stdout" }, { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
texttranslationsentencetitle
origin_index
0Bitcoin Price Update: Will China Lead us Down?Bitcoin Mise à jour de prix: La Chine nous mèn...Bitcoin Price Update: Will China Lead us Down?Bitcoin Price Update: Will China Lead us Down?
1Key Bitcoin Price Levels for Week 51 (15 – 22 ...Niveaux clés des prix Bitcoin pour la semaine ...Key Bitcoin Price Levels for Week 51 (15 – 22 ...Key Bitcoin Price Levels for Week 51 (15 – 22 ...
2National Australia Bank, Citing Highly Flawed ...Banque nationale d'Australie, Citant des donné...National Australia Bank, Citing Highly Flawed ...National Australia Bank, Citing Highly Flawed ...
3Chinese Bitcoin Ban Driven by Chinese Banking...L'interdiction de Bitcoin chinois sous l'influ...Chinese Bitcoin Ban Driven by Chinese Banking...Chinese Bitcoin Ban Driven by Chinese Banking...
4Bitcoin Trade Update: Opened PositionBitcoin Trade Update: position ouverteBitcoin Trade Update: Opened PositionBitcoin Trade Update: Opened Position
5Key Bitcoin Price Levels for Week 52 (22 – 28 ...Niveaux clés des prix Bitcoin pour la semaine ...Key Bitcoin Price Levels for Week 52 (22 – 28 ...Key Bitcoin Price Levels for Week 52 (22 – 28 ...
6Bitcoin SurvivalSurvie BitcoinBitcoin SurvivalBitcoin Survival
7Massive Bitcoin Sell Going OnVente de Bitcoin massif allant surMassive Bitcoin Sell Going OnMassive Bitcoin Sell Going On
8Why Bitcoin will rise on Monday 23rd by more t...Pourquoi Bitcoin montera le lundi 23ème de plu...Why Bitcoin will rise on Monday 23rd by more t...Why Bitcoin will rise on Monday 23rd by more t...
9Why Bitcoin is falling, and will rise againPourquoi Bitcoin est en baisse, et va se lever...Why Bitcoin is falling, and will rise againWhy Bitcoin is falling, and will rise again
10Bitcoin Price in 2014Prix Bitcoin en 2014Bitcoin Price in 2014Bitcoin Price in 2014
11This is probably the best time to invest in Bi...C'est probablement le meilleur moment pour inv...This is probably the best time to invest in Bi...This is probably the best time to invest in Bi...
12Comparing Bitcoins and OrangesComparaison des Bitcoins et des OrangesComparing Bitcoins and OrangesComparing Bitcoins and Oranges
13Key Bitcoin Price Levels for the Week AheadPrincipaux niveaux de prix Bitcoin pour la sem...Key Bitcoin Price Levels for the Week AheadKey Bitcoin Price Levels for the Week Ahead
14The 2014 Bitcoin War Has Started— And it is Bo...La guerre de Bitcoin 2014 a commencé - Et c'es...The 2014 Bitcoin War Has Started— And it is Bo...The 2014 Bitcoin War Has Started— And it is Bo...
15Two new Bitcoin ASIC Miners : Scam or Real?Deux nouveaux Bitcoin ASIC Miners: Scam ou Real?Two new Bitcoin ASIC Miners : Scam or Real?Two new Bitcoin ASIC Miners : Scam or Real?
16KnCMiner Announces 2TH/s Bitcoin ASIC MinerKNCMiner annonce 2TH/s Bitcoin ASIC MinerKnCMiner Announces 2TH/s Bitcoin ASIC MinerKnCMiner Announces 2TH/s Bitcoin ASIC Miner
17PSA: Do Not Fall for the Apple Bitcoin Miner HoaxPSA: Ne tombez pas pour le Bitcoin Apple Miner...PSA: Do Not Fall for the Apple Bitcoin Miner HoaxPSA: Do Not Fall for the Apple Bitcoin Miner Hoax
18Breaking News: HashCows Mining Pool HackedNouvelles de la nouvelle :Breaking News:Breaking News: HashCows Mining Pool Hacked
18Breaking News: HashCows Mining Pool HackedHashCows mine Pool piratéHashCows Mining Pool HackedBreaking News: HashCows Mining Pool Hacked
19Primecoin Cloud Mining using Digital Ocean – T...Primecoin Cloud Mining utilisant l'océan numér...Primecoin Cloud Mining using Digital Ocean – T...Primecoin Cloud Mining using Digital Ocean – T...
\n", "
" ], "text/plain": [ " text ... title\n", "origin_index ... \n", "0 Bitcoin Price Update: Will China Lead us Down? ... Bitcoin Price Update: Will China Lead us Down?\n", "1 Key Bitcoin Price Levels for Week 51 (15 – 22 ... ... Key Bitcoin Price Levels for Week 51 (15 – 22 ...\n", "2 National Australia Bank, Citing Highly Flawed ... ... National Australia Bank, Citing Highly Flawed ...\n", "3 Chinese Bitcoin Ban Driven by Chinese Banking... ... Chinese Bitcoin Ban Driven by Chinese Banking...\n", "4 Bitcoin Trade Update: Opened Position ... Bitcoin Trade Update: Opened Position\n", "5 Key Bitcoin Price Levels for Week 52 (22 – 28 ... ... Key Bitcoin Price Levels for Week 52 (22 – 28 ...\n", "6 Bitcoin Survival ... Bitcoin Survival\n", "7 Massive Bitcoin Sell Going On ... Massive Bitcoin Sell Going On\n", "8 Why Bitcoin will rise on Monday 23rd by more t... ... Why Bitcoin will rise on Monday 23rd by more t...\n", "9 Why Bitcoin is falling, and will rise again ... Why Bitcoin is falling, and will rise again\n", "10 Bitcoin Price in 2014 ... Bitcoin Price in 2014\n", "11 This is probably the best time to invest in Bi... ... This is probably the best time to invest in Bi...\n", "12 Comparing Bitcoins and Oranges ... Comparing Bitcoins and Oranges\n", "13 Key Bitcoin Price Levels for the Week Ahead ... Key Bitcoin Price Levels for the Week Ahead\n", "14 The 2014 Bitcoin War Has Started— And it is Bo... ... The 2014 Bitcoin War Has Started— And it is Bo...\n", "15 Two new Bitcoin ASIC Miners : Scam or Real? ... Two new Bitcoin ASIC Miners : Scam or Real?\n", "16 KnCMiner Announces 2TH/s Bitcoin ASIC Miner ... KnCMiner Announces 2TH/s Bitcoin ASIC Miner\n", "17 PSA: Do Not Fall for the Apple Bitcoin Miner Hoax ... PSA: Do Not Fall for the Apple Bitcoin Miner Hoax\n", "18 Breaking News: HashCows Mining Pool Hacked ... Breaking News: HashCows Mining Pool Hacked\n", "18 Breaking News: HashCows Mining Pool Hacked ... Breaking News: HashCows Mining Pool Hacked\n", "19 Primecoin Cloud Mining using Digital Ocean – T... ... Primecoin Cloud Mining using Digital Ocean – T...\n", "\n", "[21 rows x 4 columns]" ] }, "metadata": { "tags": [] }, "execution_count": 4 } ] }, { "cell_type": "markdown", "metadata": { "id": "it3tWEkmD-1f" }, "source": [ "# Translate English to Hebrew" ] }, { "cell_type": "code", "metadata": { "id": "j20Ci-ScdkZe", "colab": { "base_uri": "https://localhost:8080/", "height": 816 }, "outputId": "e5d3c204-a110-4bec-8e49-c35aa86bd1b2" }, "source": [ "translate_pipe = nlu.load('en.translate_to.he')\n", "tr_df = translate_pipe.predict(df)\n", "tr_df" ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ "translate_en_he download started this may take some time.\n", "Approx size to download 399.3 MB\n", "[OK!]\n" ], "name": "stdout" }, { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
texttranslationsentencetitle
origin_index
0Bitcoin Price Update: Will China Lead us Down?עדכון מחיר הביטקוין: האם סין תוביל אותנו למטה?Bitcoin Price Update: Will China Lead us Down?Bitcoin Price Update: Will China Lead us Down?
1Key Bitcoin Price Levels for Week 51 (15 – 22 ...רמת מחירי Bitcoin מפתח לשבוע 51 (15 - 22 Dec)Key Bitcoin Price Levels for Week 51 (15 – 22 ...Key Bitcoin Price Levels for Week 51 (15 – 22 ...
2National Australia Bank, Citing Highly Flawed ...בנק אוסטרליה הלאומי, ציוץ מידע שגוי ביותר, קור...National Australia Bank, Citing Highly Flawed ...National Australia Bank, Citing Highly Flawed ...
3Chinese Bitcoin Ban Driven by Chinese Banking...סיני Bitcoin באן מונע על ידי משבר הבנקאות הסיני?Chinese Bitcoin Ban Driven by Chinese Banking...Chinese Bitcoin Ban Driven by Chinese Banking...
4Bitcoin Trade Update: Opened Positionעדכון ביטקוין: מיקום פתוחBitcoin Trade Update: Opened PositionBitcoin Trade Update: Opened Position
5Key Bitcoin Price Levels for Week 52 (22 – 28 ...רמת מחירי Bitcoin מפתח לשבוע 52 (22 - 28 Dec) ...Key Bitcoin Price Levels for Week 52 (22 – 28 ...Key Bitcoin Price Levels for Week 52 (22 – 28 ...
6Bitcoin Survivalהישרדות הביטקויןBitcoin SurvivalBitcoin Survival
7Massive Bitcoin Sell Going Onמכירת Bitcoin מסיבית ממשיכהMassive Bitcoin Sell Going OnMassive Bitcoin Sell Going On
8Why Bitcoin will rise on Monday 23rd by more t...למה Bitcoin יעלה ביום שני 23 על ידי יותר מ -10%Why Bitcoin will rise on Monday 23rd by more t...Why Bitcoin will rise on Monday 23rd by more t...
9Why Bitcoin is falling, and will rise againלמה ביטקוין נופל, ויתרומם שובWhy Bitcoin is falling, and will rise againWhy Bitcoin is falling, and will rise again
10Bitcoin Price in 2014Bitcoin Price בשנת 2014Bitcoin Price in 2014Bitcoin Price in 2014
11This is probably the best time to invest in Bi...זה כנראה הזמן הטוב ביותר להשקיע בביטקוין.This is probably the best time to invest in Bi...This is probably the best time to invest in Bi...
12Comparing Bitcoins and Orangesהשוואה בין ביטקוין ותפוזיםComparing Bitcoins and OrangesComparing Bitcoins and Oranges
13Key Bitcoin Price Levels for the Week Aheadרמת מחיר Bitcoin מפתח לשבוע קדימהKey Bitcoin Price Levels for the Week AheadKey Bitcoin Price Levels for the Week Ahead
14The 2014 Bitcoin War Has Started— And it is Bo...מלחמת הביטקוין 2014 החלה - וזה בובי לי שירה את...The 2014 Bitcoin War Has Started— And it is Bo...The 2014 Bitcoin War Has Started— And it is Bo...
15Two new Bitcoin ASIC Miners : Scam or Real?שני כורים חדשים של ביטקוין:Two new Bitcoin ASIC Miners : Scam or Real?Two new Bitcoin ASIC Miners : Scam or Real?
16KnCMiner Announces 2TH/s Bitcoin ASIC MinerKNCMiner מכריז 2/S Bitcoin ASIC כורהKnCMiner Announces 2TH/s Bitcoin ASIC MinerKnCMiner Announces 2TH/s Bitcoin ASIC Miner
17PSA: Do Not Fall for the Apple Bitcoin Miner Hoaxנ.ס: אל תיפול בפח של מיינר הוקסPSA: Do Not Fall for the Apple Bitcoin Miner HoaxPSA: Do Not Fall for the Apple Bitcoin Miner Hoax
18Breaking News: HashCows Mining Pool Hackedחדשות חמות:Breaking News:Breaking News: HashCows Mining Pool Hacked
18Breaking News: HashCows Mining Pool Hackedבריכת הכרייה של \"הסכ\" נפרצהHashCows Mining Pool HackedBreaking News: HashCows Mining Pool Hacked
19Primecoin Cloud Mining using Digital Ocean – T...כריית ענן פרימקוין באמצעות האוקיינוס הדיגיטלי ...Primecoin Cloud Mining using Digital Ocean – T...Primecoin Cloud Mining using Digital Ocean – T...
\n", "
" ], "text/plain": [ " text ... title\n", "origin_index ... \n", "0 Bitcoin Price Update: Will China Lead us Down? ... Bitcoin Price Update: Will China Lead us Down?\n", "1 Key Bitcoin Price Levels for Week 51 (15 – 22 ... ... Key Bitcoin Price Levels for Week 51 (15 – 22 ...\n", "2 National Australia Bank, Citing Highly Flawed ... ... National Australia Bank, Citing Highly Flawed ...\n", "3 Chinese Bitcoin Ban Driven by Chinese Banking... ... Chinese Bitcoin Ban Driven by Chinese Banking...\n", "4 Bitcoin Trade Update: Opened Position ... Bitcoin Trade Update: Opened Position\n", "5 Key Bitcoin Price Levels for Week 52 (22 – 28 ... ... Key Bitcoin Price Levels for Week 52 (22 – 28 ...\n", "6 Bitcoin Survival ... Bitcoin Survival\n", "7 Massive Bitcoin Sell Going On ... Massive Bitcoin Sell Going On\n", "8 Why Bitcoin will rise on Monday 23rd by more t... ... Why Bitcoin will rise on Monday 23rd by more t...\n", "9 Why Bitcoin is falling, and will rise again ... Why Bitcoin is falling, and will rise again\n", "10 Bitcoin Price in 2014 ... Bitcoin Price in 2014\n", "11 This is probably the best time to invest in Bi... ... This is probably the best time to invest in Bi...\n", "12 Comparing Bitcoins and Oranges ... Comparing Bitcoins and Oranges\n", "13 Key Bitcoin Price Levels for the Week Ahead ... Key Bitcoin Price Levels for the Week Ahead\n", "14 The 2014 Bitcoin War Has Started— And it is Bo... ... The 2014 Bitcoin War Has Started— And it is Bo...\n", "15 Two new Bitcoin ASIC Miners : Scam or Real? ... Two new Bitcoin ASIC Miners : Scam or Real?\n", "16 KnCMiner Announces 2TH/s Bitcoin ASIC Miner ... KnCMiner Announces 2TH/s Bitcoin ASIC Miner\n", "17 PSA: Do Not Fall for the Apple Bitcoin Miner Hoax ... PSA: Do Not Fall for the Apple Bitcoin Miner Hoax\n", "18 Breaking News: HashCows Mining Pool Hacked ... Breaking News: HashCows Mining Pool Hacked\n", "18 Breaking News: HashCows Mining Pool Hacked ... Breaking News: HashCows Mining Pool Hacked\n", "19 Primecoin Cloud Mining using Digital Ocean – T... ... Primecoin Cloud Mining using Digital Ocean – T...\n", "\n", "[21 rows x 4 columns]" ] }, "metadata": { "tags": [] }, "execution_count": 5 } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 162 }, "id": "iXFN763icmcj", "outputId": "e614e094-0c52-486a-b9b2-5238fd4e5b40" }, "source": [ "while 1 : 1" ], "execution_count": null, "outputs": [ { "output_type": "error", "ename": "KeyboardInterrupt", "evalue": "ignored", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mwhile\u001b[0m \u001b[0;36m1\u001b[0m \u001b[0;34m:\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mKeyboardInterrupt\u001b[0m: " ] } ] }, { "cell_type": "code", "metadata": { "id": "UVmvDx7kcnV8" }, "source": [ "" ], "execution_count": null, "outputs": [] } ] }