-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
Tutorial docs
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"NLU_language_classification.ipynb","provenance":[],"collapsed_sections":[]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"EUR9cb-iQvNG"},"source":["![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)\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/classifiers/NLU_language_classification.ipynb)\n","\n","# Language Classification with NLU\n","\n","NLU can differentiate between 300 different languages by leveraging multi lingual embeddings. \n","Some of the supported languages are the following : \n","\n"," - Bulgarian \n"," - Czech\n"," - German\n"," - Greek \n"," - English \n"," - Spanish \n"," - Finnish \n"," - French \n"," - Croatian \n"," - Hungarian \n"," - Italy \n"," - Norwegian \n"," - Polish,\n"," - Portuguese \n"," - Romanian\n"," - Russian \n"," - Slovak\n"," - Swedish\n"," - Turkish \n"," - Ukrainian\n","\n","\n","# 1. Install Java and NLU"]},{"cell_type":"code","metadata":{"id":"nEIvUhjfzW7u"},"source":["!wget https://setup.johnsnowlabs.com/nlu/colab.sh -O - | bash\n"," \n","\n","import nlu"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"ZE4c3HMSkGGu"},"source":["# 2. Load NLU pipeline and predict language for data"]},{"cell_type":"code","metadata":{"id":"7GJX5d6mjk5j","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1609330480751,"user_tz":-60,"elapsed":88606,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"f14217a7-125c-4801-886c-b3929507bee5"},"source":["import nlu\n","lang_pipe = nlu.load('lang')\n","lang_pipe.predict(['NLU is an open-source text processing library for advanced natural language processing for the Python language.',\n"," 'NLU est une bibliothèque de traitement de texte open source pour le traitement avancé du langage naturel pour les langages de programmation Python.',\n"," 'NLU ist eine Open-Source Text verarbeitungs Software fuer fortgeschrittene natuerlich sprachliche Textverarbeitung in der Python Sprache '\n"," ])"],"execution_count":null,"outputs":[{"output_type":"stream","text":["detect_language_20 download started this may take some time.\n","Approx size to download 3 MB\n","[OK!]\n","Fitting on empty Dataframe, could not infer correct training method!\n"],"name":"stdout"},{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n"," .dataframe tbody tr th:only-of-type {\n"," vertical-align: middle;\n"," }\n","\n"," .dataframe tbody tr th {\n"," vertical-align: top;\n"," }\n","\n"," .dataframe thead th {\n"," text-align: right;\n"," }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n"," <thead>\n"," <tr style=\"text-align: right;\">\n"," <th></th>\n"," <th>document</th>\n"," <th>language</th>\n"," <th>language_confidence</th>\n"," </tr>\n"," <tr>\n"," <th>origin_index</th>\n"," <th></th>\n"," <th></th>\n"," <th></th>\n"," </tr>\n"," </thead>\n"," <tbody>\n"," <tr>\n"," <th>0</th>\n"," <td>NLU is an open-source text processing library ...</td>\n"," <td>en</td>\n"," <td>0.986721</td>\n"," </tr>\n"," <tr>\n"," <th>1</th>\n"," <td>NLU est une bibliothèque de traitement de text...</td>\n"," <td>fr</td>\n"," <td>0.999822</td>\n"," </tr>\n"," <tr>\n"," <th>2</th>\n"," <td>NLU ist eine Open-Source Text verarbeitungs So...</td>\n"," <td>de</td>\n"," <td>0.678322</td>\n"," </tr>\n"," </tbody>\n","</table>\n","</div>"],"text/plain":[" document ... language_confidence\n","origin_index ... \n","0 NLU is an open-source text processing library ... ... 0.986721\n","1 NLU est une bibliothèque de traitement de text... ... 0.999822\n","2 NLU ist eine Open-Source Text verarbeitungs So... ... 0.678322\n","\n","[3 rows x 3 columns]"]},"metadata":{"tags":[]},"execution_count":2}]},{"cell_type":"code","metadata":{"id":"t__qJjT9L94X"},"source":[""],"execution_count":null,"outputs":[]}]} | ||
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"NLU_language_classification.ipynb","provenance":[],"collapsed_sections":[]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"EUR9cb-iQvNG"},"source":["![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Murat-Karadag/nlu/blob/master/examples/colab/component_examples/classifiers/NLU_language_classification.ipynb)\n","\n","# Language Classification with NLU\n","\n","NLU can differentiate between 300 different languages by leveraging multi lingual embeddings. \n","Some of the supported languages are the following : \n","\n"," - Bulgarian \n"," - Czech\n"," - German\n"," - Greek \n"," - English \n"," - Spanish \n"," - Finnish \n"," - French \n"," - Croatian \n"," - Hungarian \n"," - Italy \n"," - Norwegian \n"," - Polish,\n"," - Portuguese \n"," - Romanian\n"," - Russian \n"," - Slovak\n"," - Swedish\n"," - Turkish \n"," - Ukrainian\n","\n","\n","# 1. Install Java and NLU"]},{"cell_type":"code","metadata":{"id":"nEIvUhjfzW7u"},"source":["!wget https://setup.johnsnowlabs.com/nlu/colab.sh -O - | bash\n"," \n","\n","import nlu"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"ZE4c3HMSkGGu"},"source":["# 2. Load NLU pipeline and predict language for data"]},{"cell_type":"code","metadata":{"id":"7GJX5d6mjk5j","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1609330480751,"user_tz":-60,"elapsed":88606,"user":{"displayName":"Christian Kasim Loan","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjqAD-ircKP-s5Eh6JSdkDggDczfqQbJGU_IRb4Hw=s64","userId":"14469489166467359317"}},"outputId":"f14217a7-125c-4801-886c-b3929507bee5"},"source":["import nlu\n","lang_pipe = nlu.load('lang')\n","lang_pipe.predict(['NLU is an open-source text processing library for advanced natural language processing for the Python language.',\n"," 'NLU est une bibliothèque de traitement de texte open source pour le traitement avancé du langage naturel pour les langages de programmation Python.',\n"," 'NLU ist eine Open-Source Text verarbeitungs Software fuer fortgeschrittene natuerlich sprachliche Textverarbeitung in der Python Sprache '\n"," ])"],"execution_count":null,"outputs":[{"output_type":"stream","text":["detect_language_20 download started this may take some time.\n","Approx size to download 3 MB\n","[OK!]\n","Fitting on empty Dataframe, could not infer correct training method!\n"],"name":"stdout"},{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n"," .dataframe tbody tr th:only-of-type {\n"," vertical-align: middle;\n"," }\n","\n"," .dataframe tbody tr th {\n"," vertical-align: top;\n"," }\n","\n"," .dataframe thead th {\n"," text-align: right;\n"," }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n"," <thead>\n"," <tr style=\"text-align: right;\">\n"," <th></th>\n"," <th>document</th>\n"," <th>language</th>\n"," <th>language_confidence</th>\n"," </tr>\n"," <tr>\n"," <th>origin_index</th>\n"," <th></th>\n"," <th></th>\n"," <th></th>\n"," </tr>\n"," </thead>\n"," <tbody>\n"," <tr>\n"," <th>0</th>\n"," <td>NLU is an open-source text processing library ...</td>\n"," <td>en</td>\n"," <td>0.986721</td>\n"," </tr>\n"," <tr>\n"," <th>1</th>\n"," <td>NLU est une bibliothèque de traitement de text...</td>\n"," <td>fr</td>\n"," <td>0.999822</td>\n"," </tr>\n"," <tr>\n"," <th>2</th>\n"," <td>NLU ist eine Open-Source Text verarbeitungs So...</td>\n"," <td>de</td>\n"," <td>0.678322</td>\n"," </tr>\n"," </tbody>\n","</table>\n","</div>"],"text/plain":[" document ... language_confidence\n","origin_index ... \n","0 NLU is an open-source text processing library ... ... 0.986721\n","1 NLU est une bibliothèque de traitement de text... ... 0.999822\n","2 NLU ist eine Open-Source Text verarbeitungs So... ... 0.678322\n","\n","[3 rows x 3 columns]"]},"metadata":{"tags":[]},"execution_count":2}]},{"cell_type":"code","metadata":{"id":"t__qJjT9L94X"},"source":[""],"execution_count":null,"outputs":[]}]} |