Skip to content

Commit

Permalink
updated some notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dcavar committed Mar 26, 2024
1 parent eed2e4d commit 13222e9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 28 deletions.
46 changes: 25 additions & 21 deletions notebooks/Combinatory Categorial Grammar Parsing with NLTK.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -97,7 +97,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -161,7 +161,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -177,7 +177,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -189,31 +189,35 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" you prefer that cake\n",
" NP ((S\\NP)/NP) (NP/N) N\n",
" -------------->\n",
" NP\n",
" --------------------------->\n",
" (S\\NP)\n",
"--------------------------------<\n",
" S\n"
" I will give you that cake\n",
" NP ((S\\NP)/VP) ((VP/NP)/NP) NP (NP/N) N\n",
" ------------------->\n",
" (VP/NP)\n",
" -------------->\n",
" NP\n",
" --------------------------------->\n",
" VP\n",
" ---------------------------------------------->\n",
" (S\\NP)\n",
"--------------------------------------------------<\n",
" S\n"
]
}
],
"source": [
"parse(parser, \"you prefer that cake\")"
"parse(parser, \"I will give you that cake\")"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -245,7 +249,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -254,7 +258,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -263,7 +267,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -301,7 +305,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -343,7 +347,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -411,7 +415,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.11.6"
},
"toc": {
"base_numbering": 1,
Expand Down
25 changes: 18 additions & 7 deletions notebooks/spaCy Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1052,9 +1052,20 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/damir/.local/lib/python3.11/site-packages/transformers/utils/generic.py:441: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.\n",
" _torch_pytree._register_pytree_node(\n",
"/home/damir/.local/lib/python3.11/site-packages/transformers/utils/generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.\n",
" _torch_pytree._register_pytree_node(\n"
]
}
],
"source": [
"nlp = spacy.load('en_core_web_lg')"
]
Expand All @@ -1068,7 +1079,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1084,7 +1095,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1146,7 +1157,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -2324,7 +2335,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.1"
"version": "3.11.6"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
Expand Down

0 comments on commit 13222e9

Please sign in to comment.