diff --git a/README.md b/README.md index d7490e8..79a54da 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,36 @@ -# ML Models for the Urdu language. +# NLP Models for the Urdu language. [![Price](https://img.shields.io/badge/price-FREE-0098f7.svg)](https://github.com/urduhack/models/blob/master/LICENSE) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/urduhack/models/blob/master/LICENSE) -Collection of pretrained vector models and NLP models for the Urdu language. +Collection of pretrained ML and NLP models for the Urdu language. ## Table of contents -- [Pretrained models](#pretrained_models) +- [Word2vec Models](#Word2vec) - [Bugs and feature requests](#bugs-and-feature-requests) - [Contributors](#contributors) - [Copyright and license](#copyright-and-license) -## Pretrained_models +## Word2vec -Collections of multiple vector models trained on different data. +Word2vec is a widely used for learns relationships between words and converting word into vector. -#### Word2vec -- Trained on 50,000 web news data. -- Download word2vec model link [download](https://drive.google.com/uc?export=download&id=13KLg3wUTOwWiF_YdAtZFe18j7MQmOWfb). +### Web News Data model + +- Trained on 50,000 web news posts. +- Semantic Accuracy: 36.89% +- Syntactic Accuracy: 31.25% - Demo (https://github.com/urduhack/models/blob/master/pretrained_models/word2vec/web_news_data) +### Wikipedia Data model + +- Trained on whole wikipedia corpus. +- Semantic Accuracy: 59.59% +- Syntactic Accuracy: 37.50% +- Demo (https://github.com/urduhack/models/blob/master/pretrained_models/word2vec/wikipedia) + ## Bugs and feature requests Have a bug or a feature request? If you wish to remove or update some of the features, please file an issue first before sending a PR on the repo. [please open a new issue](https://github.com/urduhack/models/issues/new). diff --git a/pretrained_models/word2vec/web_news_data/model.ipynb b/pretrained_models/word2vec/web_news_data/model.ipynb index d3fa229..6007c05 100644 --- a/pretrained_models/word2vec/web_news_data/model.ipynb +++ b/pretrained_models/word2vec/web_news_data/model.ipynb @@ -13,7 +13,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Londing the pretrained Urdu word2vec 300 dimension vector model\n", + "## Loading the pretrained Urdu word2vec 300 dimension vector model\n", "\n", "This model trainied on 50,000 news posts data." ] diff --git a/pretrained_models/word2vec/wikipedia/README.md b/pretrained_models/word2vec/wikipedia/README.md new file mode 100644 index 0000000..b502a7d --- /dev/null +++ b/pretrained_models/word2vec/wikipedia/README.md @@ -0,0 +1,84 @@ +# Pretrained Word2vec model on whole wikipedia corpus. + +## Model Description + +- Model trained on 78482 urdu wikipedia posts. +- Model vector size is 300. +- Download link (https://drive.google.com/uc?export=download&id=1yz8RfJeg65QByLs1aJUORtPujHYx_oQP) +- Semantic Accuracy: 59.59% +- Syntactic Accuracy: 37.50% +- Model can be load using python gensim package. + +## Code + +```python + +import gensim, logging +logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) + + +model = gensim.models.KeyedVectors.load_word2vec_format('urdu_wikipedia_vector300.bin', binary=True) + +print(model.most_similar("پاکستان")) +[('افغانستان', 0.534391462802887) +, ('پاکستانی', 0.527515172958374) +, ('بھارت', 0.5176973342895508) +, ('زمبابوے', 0.5033701062202454) ] + +print(model.most_similar(positive=['دہلی', 'پاکستان'], negative=['پنجاب'],topn=5)) +[('دلی', 0.47923001646995544) +, ('انڈیا', 0.4310738444328308) +, ('بھارت', 0.4303123652935028) +, ('پاکستانی', 0.42918506264686584) +, ('بیجنگ', 0.42072150111198425)] + +print(model.most_similar(positive=['ٹوکیو', 'پاکستان'], negative=['اسلام_آباد'])) +[('جاپان', 0.518461287021637), + ('جاپانی', 0.42522647976875305), + ('بھارت', 0.3991791605949402), + ('دنیا', 0.3974219858646393), + ('چین', 0.3774305582046509), + ('اوساکا', 0.3636421859264374), + ('جاپان،', 0.35131868720054626), + ('انڈیا', 0.3293466866016388), + ('عالمی', 0.32560476660728455), + ('جاپانیوں', 0.3245166540145874)] + +print(model.most_similar(positive=['بھائی', 'لڑکی'], negative=['لڑکا'])) +[('بہن', 0.5513333082199097), + ('والد', 0.532108724117279), + ('بیٹی', 0.5085018873214722), + ('والدہ', 0.48878273367881775), + ('کوقتل', 0.46216732263565063), + ('بھائیوں', 0.45481085777282715), + ('پولیس', 0.4398535490036011), + ('باپ', 0.439206600189209), + ('کزن', 0.417349249124527), + ('خاتون', 0.4159335494041443)] + +print(model.most_similar(positive=['دلہن', 'شوہر'], negative=['دولہا'])) +[('بیوی', 0.6536001563072205), + ('خاوند', 0.6006074547767639), + ('طلاق', 0.5600955486297607), + ('خاتون', 0.5458393692970276), + ('شادی', 0.5421558022499084), + ('بیٹی', 0.5145429968833923), + ('اداکارہ', 0.4982667863368988), + ('ماں', 0.4932785630226135), + ('عورت', 0.476948082447052), + ('اہلیہ', 0.4722379744052887)] + +print(model.most_similar(positive=['ملکہ', 'باپ'], negative=['بادشاہ'])) +[('ماں', 0.5100770592689514), + ('بیٹی', 0.4709329605102539), + ('بیٹے', 0.42628371715545654), + ('رشتے', 0.3735599219799042), + ('بیٹوں', 0.3722909986972809), + ('بہو', 0.37172698974609375), + ('بیوی', 0.3640066385269165), + ('بچی', 0.36133867502212524), + ('شوہر', 0.36050519347190857), + ('بہن', 0.3537209630012512)] + + +``` \ No newline at end of file diff --git a/pretrained_models/word2vec/wikipedia/__init__.py b/pretrained_models/word2vec/wikipedia/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pretrained_models/word2vec/wikipedia/model.ipynb b/pretrained_models/word2vec/wikipedia/model.ipynb new file mode 100644 index 0000000..8e5cb7f --- /dev/null +++ b/pretrained_models/word2vec/wikipedia/model.ipynb @@ -0,0 +1,417 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Pretrained Word2Vec Model on Urdu Wikipedia Corpus\n", + "\n", + "Word2vec is a widely featured as a member of the “new wave” of machine learning algorithms based on neural networks, commonly referred to as \"deep learning\" (though word2vec itself is rather shallow). Using large amounts of unannotated plain text, word2vec learns relationships between words automatically. The output are vectors, one vector per word, with remarkable linear relationships that allow us to do things like vec(“king”) – vec(“man”) + vec(“woman”) =~ vec(“queen”), or vec(“Montreal Canadiens”) – vec(“Montreal”) + vec(“Toronto”) resembles the vector for “Toronto Maple Leafs”." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Loading the pretrained Urdu word2vec 300 dimension vector model\n", + "\n", + "This model trainied on 50,000 news posts data." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# import modules & set up logging\n", + "import gensim, logging\n", + "logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# Downloading the Word2Vec model from google drive\n", + "#!wget -O - 'https://drive.google.com/uc?export=download&id=1yz8RfJeg65QByLs1aJUORtPujHYx_oQP' > urdu_wikipedia_vector300.bin\n", + "# import urllib.request\n", + "\n", + "# model_url = \"https://drive.google.com/uc?export=download&id=1yz8RfJeg65QByLs1aJUORtPujHYx_oQP\"\n", + "# file_name = \"urdu_wikipedia_vector300.bin\"\n", + "# urllib.request.urlretrieve(model_url, file_name)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2018-06-30 18:04:43,075 : INFO : loading projection weights from urdu_wikipedia_vector300.bin\n", + "2018-06-30 18:04:43,888 : INFO : loaded (49003, 300) matrix from urdu_wikipedia_vector300.bin\n" + ] + } + ], + "source": [ + "# Loading the model\n", + "model = gensim.models.KeyedVectors.load_word2vec_format('urdu_wikipedia_vector300.bin', binary=True)\n", + "# print(model)\n", + "# print(model.wv.vocab)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Evaluating\n", + "`Word2Vec` training is an unsupervised task, there’s no good way to objectively evaluate the result. Evaluation depends on your end application.\n", + "\n", + "Google has released their testing set of about 20,000 syntactic and semantic test examples, following the “A is to B as C is to D” task. It is provided in the 'datasets' folder.\n", + "\n", + "For example a syntactic analogy of comparative type is bad:worse;good:?. There are total of 9 types of syntactic comparisons in the dataset like plural nouns and nouns of opposite meaning.\n", + "\n", + "The semantic questions contain five types of semantic analogies, such as capital cities (Paris:France;Tokyo:?) or family members (brother:sister;dad:?). " + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2018-06-30 18:04:46,922 : INFO : precomputing L2-norms of word weight vectors\n" + ] + }, + { + "data": { + "text/plain": [ + "[('پنجاب', 0.7467092275619507),\n", + " ('فیصل_آباد', 0.6053035855293274),\n", + " ('یونین_کونسلیں', 0.5992769002914429),\n", + " ('سرگودھا', 0.5941762328147888),\n", + " ('اسلام_آباد', 0.5806517601013184),\n", + " ('راولپنڈی', 0.5633086562156677),\n", + " ('پاکستانی', 0.5550359487533569),\n", + " ('ساہیوال', 0.5546157360076904),\n", + " ('ضلع', 0.5504013895988464),\n", + " ('پختونخوا', 0.5464353561401367)]" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.most_similar(\"پاکستان\")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('عراق', 0.49037542939186096),\n", + " ('مصر', 0.44794124364852905),\n", + " ('عباسیہ', 0.4396800994873047),\n", + " ('المقتدی', 0.4304294288158417),\n", + " ('المتقی', 0.4190688729286194),\n", + " ('بصرہ', 0.4182446002960205),\n", + " ('باللہ', 0.4113025665283203),\n", + " ('عباسی', 0.4049525260925293),\n", + " ('واسط', 0.39807507395744324),\n", + " ('المقتفی', 0.39746952056884766)]" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.most_similar(positive=['بغداد', 'یونان'], negative=['ایتھنز'])" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('جاپان', 0.482408344745636),\n", + " ('اوساکا', 0.4233572781085968),\n", + " ('توکیو', 0.41428637504577637),\n", + " ('ہیروشیما', 0.4139555096626282),\n", + " ('اوکیناوا', 0.3928012549877167),\n", + " ('یوکوہاما', 0.39099442958831787),\n", + " ('کاناگاوا', 0.38639694452285767),\n", + " ('چوو', 0.36407244205474854),\n", + " ('چیبا', 0.3635532855987549),\n", + " ('گونما', 0.3627404272556305)]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.most_similar(positive=['ٹوکیو', 'پاکستان'], negative=['اسلام_آباد'])" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('بہن', 0.5604875087738037),\n", + " ('بیٹی', 0.5328823924064636),\n", + " ('بیوی', 0.510018527507782),\n", + " ('چچا', 0.49377816915512085),\n", + " ('ماں', 0.49138566851615906),\n", + " ('بیٹے', 0.4737793207168579),\n", + " ('بہنیں', 0.4572775363922119),\n", + " ('اپنے', 0.4566517174243927),\n", + " ('شوہر', 0.4563017785549164),\n", + " ('باپ', 0.4543006420135498)]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.most_similar(positive=['بھائی', 'لڑکی'], negative=['لڑکا'])" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('پھالکے', 0.5259937644004822),\n", + " ('دادی', 0.5064771771430969),\n", + " ('والد', 0.5038189888000488),\n", + " ('والدہ', 0.501828134059906),\n", + " ('صاحب', 0.4324100613594055),\n", + " ('بھائی', 0.43129321932792664),\n", + " ('بیٹی', 0.4238676428794861),\n", + " ('نانا', 0.4186864197254181),\n", + " ('بچپن', 0.414540559053421),\n", + " ('تھی', 0.41393712162971497)]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.most_similar(positive=['ماں', 'دادا'], negative=['باپ'])" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('شادی', 0.4839109182357788),\n", + " ('بیوی', 0.4822179675102234),\n", + " ('طلاق', 0.4765128195285797),\n", + " ('بیٹی', 0.4720294177532196),\n", + " ('عورت', 0.426933228969574),\n", + " ('بیوہ', 0.4230973422527313),\n", + " ('زوجیت', 0.40840286016464233),\n", + " ('بائن', 0.40645647048950195),\n", + " ('ماں', 0.39884424209594727),\n", + " ('خاوند', 0.38704994320869446)]" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.most_similar(positive=['دلہن', 'شوہر'], negative=['دولہا'])" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('ماں', 0.5418938994407654),\n", + " ('بہن', 0.4456590414047241),\n", + " ('وکٹوریہ', 0.42152002453804016),\n", + " ('شوہر', 0.4130823612213135),\n", + " ('پرورش', 0.40089383721351624),\n", + " ('والدین', 0.39476436376571655),\n", + " ('بیٹی', 0.38815945386886597),\n", + " ('بہنیں', 0.3837417960166931),\n", + " ('علاتی', 0.3805781900882721),\n", + " ('بیوی', 0.36311426758766174)]" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.most_similar(positive=['ملکہ', 'باپ'], negative=['بادشاہ'])" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 2.90719718e-01, -1.54507101e-01, -1.01328149e-01, 2.22087190e-01,\n", + " -3.07357967e-01, -4.02863398e-02, -5.57583682e-02, 1.13708153e-01,\n", + " 3.64474282e-02, 1.82163820e-01, -1.03520408e-01, -7.86808804e-02,\n", + " -1.73256442e-01, 1.38376638e-01, -4.12036739e-02, -2.63018042e-01,\n", + " 5.62551692e-02, -1.17260098e-01, -7.21818581e-02, 1.15282960e-01,\n", + " 3.13853800e-01, 1.01477422e-01, -5.95420636e-02, -2.33268905e-02,\n", + " 9.58233029e-02, 1.53424725e-01, 1.02251381e-01, -6.76823035e-02,\n", + " -1.50715426e-01, 8.69434401e-02, -1.76381662e-01, 9.32310522e-02,\n", + " -2.59102434e-01, 1.19624197e-01, -1.10111170e-01, -1.76104322e-01,\n", + " -4.41194586e-02, -2.03329138e-02, 1.74071994e-02, 5.92087135e-02,\n", + " 5.02466500e-01, -9.65452045e-02, 1.82059482e-01, -1.86802164e-01,\n", + " -2.26636663e-01, 2.67531220e-02, 3.24652210e-05, 1.36122927e-01,\n", + " 1.86685532e-01, 1.75396845e-01, -1.99274853e-01, 2.08395988e-01,\n", + " -4.25279647e-01, 9.44566578e-02, -2.93204278e-01, 4.17766673e-03,\n", + " -1.33476127e-02, 1.30162006e-02, 7.51131549e-02, 1.46706000e-01,\n", + " 1.50662437e-01, 1.42502919e-01, 2.60755539e-01, 1.12259701e-01,\n", + " -1.67522263e-02, 4.45824713e-02, 1.03183232e-01, -1.72097638e-01,\n", + " -1.77416325e-01, -3.02936018e-01, 1.85511708e-01, 1.20603003e-01,\n", + " 1.53278977e-01, 1.32741153e-01, 1.87655553e-01, -2.06282344e-02,\n", + " -9.35538337e-02, -2.08818898e-01, 9.56980065e-02, -9.39392298e-02,\n", + " -4.16097134e-01, -3.43512952e-01, 2.50260532e-01, -8.38642847e-03,\n", + " -2.29468271e-01, 1.44283175e-01, 1.42679214e-01, 3.40207785e-01,\n", + " -7.95996040e-02, 5.77358417e-02, -1.34218439e-01, 2.42220104e-01,\n", + " 1.23033293e-01, -1.17620550e-01, -6.84172511e-02, -1.28572017e-01,\n", + " -2.33335778e-01, 1.27957994e-03, -1.93791658e-01, -3.97418112e-01,\n", + " -6.15759306e-02, 4.27085534e-02, -1.41970813e-01, -3.48327935e-01,\n", + " 1.06691159e-01, -3.58235121e-01, 1.06460795e-01, 2.53371954e-01,\n", + " -2.13935718e-01, 4.00731862e-02, 1.26623362e-01, -1.14768863e-01,\n", + " -9.57155079e-02, 1.73408072e-02, -1.50378095e-02, 1.92165434e-01,\n", + " -2.33835801e-01, 2.45060578e-01, 7.26438686e-03, 4.25110236e-02,\n", + " -7.09762499e-02, 4.64119129e-02, -3.35842967e-02, -4.45897020e-02,\n", + " 6.73349947e-02, -1.29928946e-01, 2.32854500e-01, -1.46675527e-01,\n", + " -1.39960367e-02, -1.35824397e-01, -2.73943514e-01, 4.08940703e-01,\n", + " 3.23622584e-01, -8.31404999e-02, -8.68467428e-03, 9.22847986e-02,\n", + " 3.03653091e-01, -1.38246059e-01, 2.06895664e-01, -1.29221395e-01,\n", + " 1.53460100e-01, 2.28752822e-01, -1.34854943e-01, 2.55338639e-01,\n", + " 2.56092072e-01, -4.35164012e-02, -1.49443612e-01, 2.10392088e-01,\n", + " 4.10906315e-01, 2.48550430e-01, 5.22409705e-03, 1.43126860e-01,\n", + " 1.13950491e-01, -8.84596035e-02, 2.58539557e-01, 1.31380975e-01,\n", + " 2.83675790e-01, 2.60919213e-01, -1.29556209e-01, -2.08280444e-01,\n", + " -2.85545409e-01, 5.23601510e-02, -2.32341200e-01, 4.85041320e-01,\n", + " -3.93856876e-02, -5.01451977e-02, 1.69702530e-01, 9.15008113e-02,\n", + " -1.22396424e-02, 4.02199179e-01, 1.35392457e-01, -1.85359687e-01,\n", + " 4.63815220e-02, 1.02271959e-01, 3.09806526e-01, -5.53513765e-02,\n", + " -3.08888942e-01, 2.53099591e-01, -2.29328796e-01, 1.23050790e-02,\n", + " -2.00640671e-02, 3.35022539e-01, -1.70630544e-01, 3.13268602e-02,\n", + " 3.61864828e-02, -2.05083057e-01, -6.70595840e-02, 3.08525801e-01,\n", + " -1.86056286e-01, 1.25159875e-01, 2.85388064e-02, 3.07312105e-02,\n", + " 3.10157407e-02, -1.72013804e-01, -8.49328563e-03, -1.32103354e-01,\n", + " -1.95904240e-01, -1.58522844e-01, -8.36861059e-02, 7.21051693e-02,\n", + " -3.28140818e-02, -2.11747969e-03, 1.45621700e-02, 4.77016754e-02,\n", + " 1.65115595e-01, 1.00251280e-01, -2.34798044e-01, -1.59505278e-01,\n", + " -1.52136460e-01, 4.16450538e-02, -3.00514579e-01, 2.02226657e-02,\n", + " 1.32335901e-01, 2.78733462e-01, 1.75445573e-03, -4.33470421e-02,\n", + " -3.68493423e-02, -6.61398098e-02, 1.73372552e-01, 2.65962541e-01,\n", + " 2.14032643e-02, 3.37233037e-01, -4.76786382e-02, -1.22924156e-01,\n", + " -2.40642205e-01, -1.35834649e-01, 1.54545993e-01, 7.92739391e-02,\n", + " -1.49741843e-01, 1.77755415e-01, 1.22221157e-01, -1.29623577e-01,\n", + " 1.55232668e-01, 3.09898444e-02, 1.65027548e-02, -1.52057856e-01,\n", + " -1.31213665e-01, 7.90614039e-02, -6.97262809e-02, 2.11870670e-01,\n", + " 7.41719967e-03, -5.89860417e-02, -8.39254186e-02, -3.15583020e-01,\n", + " 2.44558617e-01, 3.66958469e-01, -1.19469203e-01, 2.63464034e-01,\n", + " 3.14754397e-01, -2.04126298e-01, 2.25210525e-02, 2.13292137e-01,\n", + " -2.15125233e-01, -1.68398559e-01, 2.93002725e-01, -1.69381984e-02,\n", + " 9.23261493e-02, -8.96509439e-02, -1.24198282e-02, -1.88067481e-02,\n", + " -1.65381014e-01, 5.94857559e-02, 3.83150317e-02, -2.16927499e-01,\n", + " -2.55104542e-01, -2.88952857e-01, -3.45313884e-02, 1.47020176e-01,\n", + " -8.34442601e-02, 1.98590711e-01, 2.75498033e-01, -3.03852726e-02,\n", + " -3.35725605e-01, 5.81392609e-02, 6.42859116e-02, -1.03365384e-01,\n", + " -2.79283784e-02, -2.50238571e-02, 8.65042210e-02, 1.01050027e-01,\n", + " 1.84338838e-01, -1.07080722e-02, 1.10035241e-01, -1.80860481e-03,\n", + " 8.80000591e-02, 4.99829017e-02, -6.46389043e-03, 2.40271464e-01,\n", + " 1.55365229e-01, -4.76258807e-02, 1.45980045e-01, -1.49514139e-01,\n", + " -2.39011142e-02, -2.40136608e-01, 1.46699280e-01, -1.90538749e-01,\n", + " -9.99240950e-02, -7.44266063e-02, 2.15844095e-01, -1.89282924e-01],\n", + " dtype=float32)" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model['پاکستان']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +}