Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions GateNLP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@
"from gatenlp.processing.tokenizer import NLTKTokenizer\n",
"from nltk.tokenize import TreebankWordTokenizer\n",
"\n",
"tokenizer = NLTKTokenizer(nltk_tokenizer=TreebankWordTokenizer(), out_set=\"NLTK\")\n",
"tokenizer = NLTKTokenizer(nltk_tokenizer=TreebankWordTokenizer(), outset_name=\"NLTK\")\n",
"tokenizer(doc)"
]
},
Expand Down Expand Up @@ -888,7 +888,10 @@
" (\"Benadryl\", dict(url=\"https://www.drugs.com/benadryl.html\")),\n",
" (\"Patanol\", dict(url=\"https://www.drugs.com/patanol.html\")),\n",
" (\"Allegra\", dict(url=\"https://www.drugs.com/allegra.html\"))\n",
"]"
"]\n",
"\n",
"# Print the medications list to inspect its structure\n",
"print(\"Medications List:\", medications)\n"
]
},
{
Expand All @@ -915,9 +918,15 @@
"source": [
"from gatenlp.processing.gazetteer import TokenGazetteer\n",
"\n",
"medications = [(txt.split(), feats) for txt, feats in medications]\n",
"medications = [(text.split(), feats) for text, feats in medications]\n",
"\n",
"medications_gazetteer = TokenGazetteer(medications, fmt=\"gazlist\", outtype=\"Medication\", annset=\"NLTK\", outset=\"gazetteer\")"
"medications_gazetteer = TokenGazetteer(\n",
" source=medications,\n",
" source_fmt=\"gazlist\",\n",
" ann_type=\"Medication\",\n",
" annset_name=\"NLTK\",\n",
" outset_name=\"gazetteer\"\n",
")"
]
},
{
Expand Down