Skip to content

Commit c18e633

Browse files
authored
Merge pull request #6 from TheFlash10/TheFlash10-patch-1
Completing the Part-of-Speech-Tagging.ipynb
2 parents b66de59 + 0101bc8 commit c18e633

1 file changed

Lines changed: 34 additions & 12 deletions

File tree

8 Part-of-speech tagging.ipynb

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Part-of-speech tagging"
8+
]
9+
},
310
{
411
"cell_type": "code",
5-
"execution_count": 1,
12+
"execution_count": 16,
613
"metadata": {},
714
"outputs": [],
815
"source": [
@@ -14,14 +21,30 @@
1421
"inferretque deos Latio, genus unde Latinum,\n",
1522
"Albanique patres, atque altae moenia Romae.\"\"\"\n",
1623
"\n",
17-
"# Remove line breaks\n",
18-
"\n",
19-
"aen = aen.replace('\\n', ' ')"
24+
"# rm line breaks\n",
25+
"aen = aen.replace('\\n',' ')"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": 17,
31+
"metadata": {},
32+
"outputs": [
33+
{
34+
"name": "stdout",
35+
"output_type": "stream",
36+
"text": [
37+
"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"
38+
]
39+
}
40+
],
41+
"source": [
42+
"print(aen)"
2043
]
2144
},
2245
{
2346
"cell_type": "code",
24-
"execution_count": 2,
47+
"execution_count": 18,
2548
"metadata": {},
2649
"outputs": [],
2750
"source": [
@@ -30,18 +53,17 @@
3053
},
3154
{
3255
"cell_type": "code",
33-
"execution_count": 3,
56+
"execution_count": 19,
3457
"metadata": {},
3558
"outputs": [],
3659
"source": [
3760
"tagger = POSTag('latin')\n",
38-
"\n",
3961
"aen_tagged = tagger.tag_ngram_123_backoff(aen)"
4062
]
4163
},
4264
{
4365
"cell_type": "code",
44-
"execution_count": 4,
66+
"execution_count": 20,
4567
"metadata": {},
4668
"outputs": [
4769
{
@@ -58,7 +80,7 @@
5880
},
5981
{
6082
"cell_type": "code",
61-
"execution_count": 6,
83+
"execution_count": 21,
6284
"metadata": {},
6385
"outputs": [],
6486
"source": [
@@ -69,7 +91,7 @@
6991
},
7092
{
7193
"cell_type": "code",
72-
"execution_count": 7,
94+
"execution_count": 23,
7395
"metadata": {},
7496
"outputs": [
7597
{
@@ -81,7 +103,7 @@
81103
}
82104
],
83105
"source": [
84-
" print(aen_tagged)"
106+
"print(aen_tagged)"
85107
]
86108
}
87109
],
@@ -101,7 +123,7 @@
101123
"name": "python",
102124
"nbconvert_exporter": "python",
103125
"pygments_lexer": "ipython3",
104-
"version": "3.6.4"
126+
"version": "3.6.2"
105127
}
106128
},
107129
"nbformat": 4,

0 commit comments

Comments
 (0)