|
9 | 9 | }, |
10 | 10 | { |
11 | 11 | "cell_type": "code", |
12 | | - "execution_count": 2, |
| 12 | + "execution_count": 1, |
13 | 13 | "metadata": {}, |
14 | 14 | "outputs": [ |
15 | 15 | { |
16 | 16 | "name": "stdout", |
17 | 17 | "output_type": "stream", |
18 | 18 | "text": [ |
19 | | - "Collecting requests\n", |
20 | | - " Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl\n", |
21 | | - "Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)\n", |
22 | | - " Using cached https://files.pythonhosted.org/packages/e1/e5/df302e8017440f111c11cc41a6b432838672f5a70aa29227bf58149dc72f/urllib3-1.25.9-py2.py3-none-any.whl\n", |
23 | | - "Collecting chardet<4,>=3.0.2 (from requests)\n", |
24 | | - " Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl\n", |
25 | | - "Requirement already satisfied: certifi>=2017.4.17 in /home/etherealenvy/miniconda3/envs/practicalnlp/lib/python3.5/site-packages (from requests) (2018.8.24)\n", |
26 | | - "Collecting idna<3,>=2.5 (from requests)\n", |
27 | | - " Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl\n", |
28 | | - "\u001b[31mjupyterlab-server 1.0.0 has requirement jsonschema>=3.0.1, but you'll have jsonschema 2.6.0 which is incompatible.\u001b[0m\n", |
29 | | - "\u001b[31mjupyterlab 2.1.0 has requirement jupyterlab_server>=1.1.0, but you'll have jupyterlab-server 1.0.0 which is incompatible.\u001b[0m\n", |
30 | | - "Installing collected packages: urllib3, chardet, idna, requests\n", |
31 | | - "Successfully installed chardet-3.0.4 idna-2.9 requests-2.23.0 urllib3-1.25.9\n", |
32 | | - "\u001b[33mYou are using pip version 10.0.1, however version 20.1 is available.\n", |
33 | | - "You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n" |
| 19 | + "Requirement already satisfied: requests in c:\\users\\sukee\\appdata\\local\\programs\\python\\python37\\lib\\site-packages (2.25.1)" |
| 20 | + ] |
| 21 | + }, |
| 22 | + { |
| 23 | + "name": "stderr", |
| 24 | + "output_type": "stream", |
| 25 | + "text": [ |
| 26 | + "WARNING: You are using pip version 20.1.1; however, version 21.1.1 is available.\n", |
| 27 | + "You should consider upgrading via the 'c:\\users\\sukee\\appdata\\local\\programs\\python\\python37\\python.exe -m pip install --upgrade pip' command.\n" |
| 28 | + ] |
| 29 | + }, |
| 30 | + { |
| 31 | + "name": "stdout", |
| 32 | + "output_type": "stream", |
| 33 | + "text": [ |
| 34 | + "\n", |
| 35 | + "Requirement already satisfied: chardet<5,>=3.0.2 in c:\\users\\sukee\\appdata\\local\\programs\\python\\python37\\lib\\site-packages (from requests) (4.0.0)\n", |
| 36 | + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\\users\\sukee\\appdata\\local\\programs\\python\\python37\\lib\\site-packages (from requests) (1.25.9)\n", |
| 37 | + "Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\sukee\\appdata\\local\\programs\\python\\python37\\lib\\site-packages (from requests) (2020.12.5)\n", |
| 38 | + "Requirement already satisfied: idna<3,>=2.5 in c:\\users\\sukee\\appdata\\local\\programs\\python\\python37\\lib\\site-packages (from requests) (2.10)\n" |
34 | 39 | ] |
35 | 40 | } |
36 | 41 | ], |
|
53 | 58 | "metadata": {}, |
54 | 59 | "outputs": [], |
55 | 60 | "source": [ |
56 | | - "#You will need a subscription key - you can use trial version\n", |
| 61 | + "# You will need a subscription key - you can use trial version\n", |
| 62 | + "# This will be user based\n", |
| 63 | + "\n", |
57 | 64 | "subscription_key = \"XXXX\"\n", |
58 | 65 | "endpoint = \"https://api-nam.cognitive.microsofttranslator.com\"\n", |
59 | 66 | "path = '/translate?api-version=3.0'\n", |
60 | 67 | "params = '&to=de' #From English to German (de)\n", |
61 | | - "constructed_url = endpoint + path + params\n" |
| 68 | + "constructed_url = endpoint + path + params" |
62 | 69 | ] |
63 | 70 | }, |
64 | 71 | { |
|
80 | 87 | "print(json.dumps(response, sort_keys=True, indent=4, separators=(',', ': ')))\n" |
81 | 88 | ] |
82 | 89 | }, |
83 | | - { |
84 | | - "cell_type": "markdown", |
85 | | - "metadata": {}, |
86 | | - "source": [ |
87 | | - "Google Cloud also has a translate service, which can be explored as an additional exercise." |
88 | | - ] |
89 | | - }, |
90 | 90 | { |
91 | 91 | "cell_type": "code", |
92 | 92 | "execution_count": null, |
93 | 93 | "metadata": {}, |
94 | 94 | "outputs": [], |
95 | 95 | "source": [ |
| 96 | + "Google Cloud also has a translate service, which can be explored as an additional exercise.\n", |
96 | 97 | "#todo: get a trial subscription key and show output for this, and perhaps add google example code from: https://cloud.google.com/translate/docs" |
97 | 98 | ] |
98 | | - }, |
99 | | - { |
100 | | - "cell_type": "code", |
101 | | - "execution_count": null, |
102 | | - "metadata": {}, |
103 | | - "outputs": [], |
104 | | - "source": [] |
105 | 99 | } |
106 | 100 | ], |
107 | 101 | "metadata": { |
|
120 | 114 | "name": "python", |
121 | 115 | "nbconvert_exporter": "python", |
122 | 116 | "pygments_lexer": "ipython3", |
123 | | - "version": "3.5.6" |
| 117 | + "version": "3.7.9" |
124 | 118 | } |
125 | 119 | }, |
126 | 120 | "nbformat": 4, |
127 | | - "nbformat_minor": 2 |
| 121 | + "nbformat_minor": 4 |
128 | 122 | } |
0 commit comments