Skip to content

Commit

Permalink
NLP Applications
Browse files Browse the repository at this point in the history
  • Loading branch information
nursnaaz committed Sep 13, 2019
1 parent f0b96b2 commit 77c7a79
Show file tree
Hide file tree
Showing 13 changed files with 19,639 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand All @@ -1618,12 +1618,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: en_core_web_sm==2.1.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz#egg=en_core_web_sm==2.1.0 in /usr/local/lib/python3.6/dist-packages (2.1.0)\n",
"Requirement already satisfied: en_core_web_sm==2.1.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz#egg=en_core_web_sm==2.1.0 in /anaconda3/lib/python3.6/site-packages\n",
"\u001b[33mYou are using pip version 9.0.3, however version 19.2.3 is available.\n",
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n",
"\u001b[38;5;2m✔ Download and installation successful\u001b[0m\n",
"You can now load the model via spacy.load('en_core_web_sm')\n",
"\u001b[38;5;2m✔ Linking successful\u001b[0m\n",
"/usr/local/lib/python3.6/dist-packages/en_core_web_sm -->\n",
"/usr/local/lib/python3.6/dist-packages/spacy/data/en\n",
"/anaconda3/lib/python3.6/site-packages/en_core_web_sm -->\n",
"/anaconda3/lib/python3.6/site-packages/spacy/data/en\n",
"You can now load the model via spacy.load('en')\n"
]
}
Expand All @@ -1634,7 +1636,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 3,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand All @@ -1649,7 +1651,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: en_vectors_web_lg==2.1.0 from https://github.com/explosion/spacy-models/releases/download/en_vectors_web_lg-2.1.0/en_vectors_web_lg-2.1.0.tar.gz#egg=en_vectors_web_lg==2.1.0 in /usr/local/lib/python3.6/dist-packages (2.1.0)\n",
"Collecting en_vectors_web_lg==2.1.0 from https://github.com/explosion/spacy-models/releases/download/en_vectors_web_lg-2.1.0/en_vectors_web_lg-2.1.0.tar.gz#egg=en_vectors_web_lg==2.1.0\n",
" Downloading https://github.com/explosion/spacy-models/releases/download/en_vectors_web_lg-2.1.0/en_vectors_web_lg-2.1.0.tar.gz (661.8MB)\n",
"\u001b[K 100% |████████████████████████████████| 661.8MB 7.8MB/s eta 0:00:011.4MB/s eta 0:00:05 | 215.6MB 99.1MB/s eta 0:00:05 38% |████████████▏ | 251.7MB 101.9MB/s eta 0:00:0539% |████████████▋ | 261.2MB 100.1MB/s eta 0:00:05 eta 0:00:09/s eta 0:00:05 | 292.8MB 98.7MB/s eta 0:00:04 45% |██████████████▍ | 298.7MB 64.2MB/s eta 0:00:06 51% |████████████████▍ | 340.0MB 13.4MB/s eta 0:00:24MB 38.6MB/s eta 0:00:09██████████ | 353.4MB 105.6MB/s eta 0:00:03��████▊ | 367.5MB 30.6MB/s eta 0:00:10�███ | 370.9MB 8.4MB/s eta 0:00:35�██████████▏ | 376.2MB 24.4MB/s eta 0:00:12 57% |██████████████████▍ | 379.4MB 15.6MB/s eta 0:00:19| 419.5MB 101.6MB/s eta 0:00:03��████▍ | 421.4MB 27.4MB/s eta 0:00:09 64% |████████████████████▋ | 426.1MB 1.2MB/s eta 0:03:24451.5MB 30.0MB/s eta 0:00:08██████████████████ | 456.7MB 28.1MB/s eta 0:00:08��█████████████▍ | 462.2MB 79.4MB/s eta 0:00:03 | 468.2MB 29.9MB/s eta 0:00:07��███████▊ | 470.2MB 50.2MB/s eta 0:00:04�███████████▉ | 471.7MB 28.0MB/s eta 0:00:07��██████████████ | 476.8MB 73.4MB/s eta 0:00:03:08��████████████▎ | 482.3MB 98.0MB/s eta 0:00:024% |███████████████████████▊ | 489.9MB 22.8MB/s eta 0:00:08��▉ | 493.3MB 31.7MB/s eta 0:00:06██████████████████████ | 519.2MB 91.7MB/s eta 0:00:02��██████████████▋ | 528.8MB 74.7MB/s eta 0:00:02�� | 530.1MB 73.5MB/s eta 0:00:0280% |█████████████████████████▊ | 533.1MB 75.7MB/s eta 0:00:02█████████████████▉ | 534.2MB 21.4MB/s eta 0:00:06█████████████████████▉ | 535.4MB 89.8MB/s eta 0:00:02MB/s eta 0:00:05MB/s eta 0:00:06��█████████████████████▌ | 548.9MB 70.6MB/s eta 0:00:02B/s eta 0:00:02██████▋ | 551.2MB 21.0MB/s eta 0:00:06ta 0:00:06�██████████████████████▋ | 570.0MB 23.3MB/s eta 0:00:04████▋ | 571.3MB 18.2MB/s eta 0:00:05�██▊ | 573.8MB 90.3MB/s eta 0:00:01 87% |████████████████████████████ | 578.6MB 67.7MB/s eta 0:00:02�███████▍ | 587.9MB 21.0MB/s eta 0:00:04 89% |████████████████████████████▋ | 592.4MB 4.3MB/s eta 0:00:17�██████████▊ | 594.1MB 56.1MB/s eta 0:00:02�█▉ | 596.0MB 57.0MB/s eta 0:00:02��███████████████ | 599.6MB 15.5MB/s eta 0:00:05��███████████████████████████ | 601.7MB 63.1MB/s eta 0:00:01�█████████████▏ | 603.3MB 54.8MB/s eta 0:00:02████████████████████████████▏ | 604.4MB 16.9MB/s eta 0:00:04 |█████████████████████████████▍ | 608.3MB 57.1MB/s eta 0:00:01.9MB/s eta 0:00:03B/s eta 0:00:03███████▋ | 611.4MB 14.9MB/s eta 0:00:04��███████▊ | 613.8MB 58.6MB/s eta 0:00:01███████▊ | 615.5MB 14.0MB/s eta 0:00:04 93% |█████████████████████████████▉ | 616.1MB 8.4MB/s eta 0:00:06��██████████████████████████ | 618.6MB 14.4MB/s eta 0:00:03 93% |██████████████████████████████ | 620.1MB 14.3MB/s eta 0:00:03███████████████████████████ | 620.8MB 19.6MB/s eta 0:00:03��██████████████████████████ | 622.3MB 14.3MB/s eta 0:00:03��████████████▏ | 623.6MB 16.6MB/s eta 0:00:03�███████████▍ | 627.9MB 20.2MB/s eta 0:00:02 19.7MB/s eta 0:00:02 95% |██████████████████████████████▌ | 629.7MB 496kB/s eta 0:01:05��█████████████████▋ | 632.8MB 17.0MB/s eta 0:00:02��████████████▋ | 634.2MB 16.4MB/s eta 0:00:02��████████████▊ | 635.8MB 15.5MB/s eta 0:00:02��████████████▉ | 636.7MB 15.7MB/s eta 0:00:02████████████████ | 640.2MB 17.9MB/s eta 0:00:02�████████████ | 641.6MB 100.4MB/s eta 0:00:01��█████████████ | 642.5MB 16.8MB/s eta 0:00:02��█████████████████▎| 645.9MB 103.0MB/s eta 0:00:01�██████████████████▎| 647.4MB 16.7MB/s eta 0:00:01�██████████████████▍| 649.5MB 16.8MB/s eta 0:00:01�█▌| 651.7MB 14.9MB/s eta 0:00:01███████████████████████████▋| 653.4MB 55.9MB/s eta 0:00:01��██████████▋| 654.3MB 58.5MB/s eta 0:00:01�██████████████████▉| 658.2MB 15.5MB/s eta 0:00:01��███████████| 660.2MB 16.9MB/s eta 0:00:01\n",
"\u001b[?25hInstalling collected packages: en-vectors-web-lg\n",
" Running setup.py install for en-vectors-web-lg ... \u001b[?25ldone\n",
"\u001b[?25hSuccessfully installed en-vectors-web-lg-2.1.0\n",
"\u001b[33mYou are using pip version 9.0.3, however version 19.2.3 is available.\n",
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n",
"\u001b[38;5;2m✔ Download and installation successful\u001b[0m\n",
"You can now load the model via spacy.load('en_vectors_web_lg')\n"
]
Expand All @@ -1661,7 +1670,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand All @@ -1673,10 +1682,16 @@
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Total word vectors: 1070971\n"
"ename": "OSError",
"evalue": "[E050] Can't find model 'en_vectors_web_lg'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mOSError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-9d0bfbece33a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mspacy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mnlp\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mspacy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'en_vectors_web_lg'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0mtotal_vectors\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnlp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvocab\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvectors\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/anaconda3/lib/python3.6/site-packages/spacy/__init__.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(name, **overrides)\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mdepr_path\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0mdeprecation_warning\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mWarnings\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mW001\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdepr_path\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 27\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mutil\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0moverrides\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 28\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 29\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/anaconda3/lib/python3.6/site-packages/spacy/util.py\u001b[0m in \u001b[0;36mload_model\u001b[0;34m(name, **overrides)\u001b[0m\n\u001b[1;32m 137\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"exists\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# Path or Path-like to model data\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 138\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mload_model_from_path\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0moverrides\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 139\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mIOError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mErrors\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mE050\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 140\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 141\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mOSError\u001b[0m: [E050] Can't find model 'en_vectors_web_lg'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory."
]
}
],
Expand Down
Binary file not shown.
Loading

0 comments on commit 77c7a79

Please sign in to comment.