Skip to content

Commit

Permalink
Merge pull request #6 from TheFlash10/TheFlash10-patch-1
Browse files Browse the repository at this point in the history
Completing the Part-of-Speech-Tagging.ipynb
  • Loading branch information
kylepjohnson committed Feb 20, 2018
2 parents b66de59 + 0101bc8 commit c18e633
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions 8 Part-of-speech tagging.ipynb
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Part-of-speech tagging"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -14,14 +21,30 @@
"inferretque deos Latio, genus unde Latinum,\n",
"Albanique patres, atque altae moenia Romae.\"\"\"\n",
"\n",
"# Remove line breaks\n",
"\n",
"aen = aen.replace('\\n', ' ')"
"# rm line breaks\n",
"aen = aen.replace('\\n',' ')"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"arma virumque cano, Troiae qui primus ab oris Italiam, fato profugus, Laviniaque venit litora, multum ille et terris iactatus et alto vi superum saevae memorem Iunonis ob iram; multa quoque et bello passus, dum conderet urbem, 5 inferretque deos Latio, genus unde Latinum, Albanique patres, atque altae moenia Romae.\n"
]
}
],
"source": [
"print(aen)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -30,18 +53,17 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"tagger = POSTag('latin')\n",
"\n",
"aen_tagged = tagger.tag_ngram_123_backoff(aen)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 20,
"metadata": {},
"outputs": [
{
Expand All @@ -58,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -69,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 23,
"metadata": {},
"outputs": [
{
Expand All @@ -81,7 +103,7 @@
}
],
"source": [
" print(aen_tagged)"
"print(aen_tagged)"
]
}
],
Expand All @@ -101,7 +123,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.2"
}
},
"nbformat": 4,
Expand Down

0 comments on commit c18e633

Please sign in to comment.