Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
N
NLP-Project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
almohanad.hafez
NLP-Project
Commits
7f83dc75
Commit
7f83dc75
authored
Nov 02, 2024
by
Almouhannad Hafez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(3) Add stanza output to lemmatizer
parent
ba4e54ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
11 deletions
+58
-11
3.1.Lemmatizer.ipynb
3.1.Lemmatizer.ipynb
+58
-11
No files found.
3.1.Lemmatizer.ipynb
View file @
7f83dc75
...
@@ -96,8 +96,8 @@
...
@@ -96,8 +96,8 @@
"name": "stderr",
"name": "stderr",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"2024-11-02 21:
15:19
WARNING: Language en package default expects mwt, which has been added\n",
"2024-11-02 21:
57:37
WARNING: Language en package default expects mwt, which has been added\n",
"2024-11-02 21:
15:19
INFO: Loading these models for language: en (English):\n",
"2024-11-02 21:
57:37
INFO: Loading these models for language: en (English):\n",
"=================================\n",
"=================================\n",
"| Processor | Package |\n",
"| Processor | Package |\n",
"---------------------------------\n",
"---------------------------------\n",
...
@@ -107,12 +107,12 @@
...
@@ -107,12 +107,12 @@
"| lemma | combined_nocharlm |\n",
"| lemma | combined_nocharlm |\n",
"=================================\n",
"=================================\n",
"\n",
"\n",
"2024-11-02 21:
15:19
INFO: Using device: cpu\n",
"2024-11-02 21:
57:37
INFO: Using device: cpu\n",
"2024-11-02 21:
15:19
INFO: Loading: tokenize\n",
"2024-11-02 21:
57:37
INFO: Loading: tokenize\n",
"2024-11-02 21:
15:21
INFO: Loading: mwt\n",
"2024-11-02 21:
57:38
INFO: Loading: mwt\n",
"2024-11-02 21:
15:21
INFO: Loading: pos\n",
"2024-11-02 21:
57:38
INFO: Loading: pos\n",
"2024-11-02 21:
15:22
INFO: Loading: lemma\n",
"2024-11-02 21:
57:38
INFO: Loading: lemma\n",
"2024-11-02 21:
15:22
INFO: Done loading processors!\n"
"2024-11-02 21:
57:38
INFO: Done loading processors!\n"
]
]
}
}
],
],
...
@@ -347,11 +347,58 @@
...
@@ -347,11 +347,58 @@
"# ***2- Stanza lemmatizer***"
"# ***2- Stanza lemmatizer***"
]
]
},
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**42 minutes to execute!**"
]
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
16
,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Train Accuracy: 0.9942112879884226\n",
"Test Accuracy: 0.9285714285714286\n",
"+---------------------------------+--------------------+--------------------+------------+-----------+\n",
"| Class | Precision | Recall | F1-score | Support |\n",
"|---------------------------------+--------------------+--------------------+------------+-----------|\n",
"| acne | 0.95 | 1.0 | 0.974359 | 19.0 |\n",
"| allergy | 0.9411764705882353 | 0.8421052631578947 | 0.888889 | 19.0 |\n",
"| arthritis | 0.875 | 1.0 | 0.933333 | 14.0 |\n",
"| bronchial asthma | 0.7391304347826086 | 1.0 | 0.85 | 17.0 |\n",
"| cervical spondylosis | 1.0 | 1.0 | 1 | 21.0 |\n",
"| chicken pox | 0.8421052631578947 | 0.8421052631578947 | 0.842105 | 19.0 |\n",
"| common cold | 0.8888888888888888 | 0.8888888888888888 | 0.888889 | 18.0 |\n",
"| dengue | 0.6363636363636364 | 0.875 | 0.736842 | 16.0 |\n",
"| diabetes | 1.0 | 0.6842105263157895 | 0.8125 | 19.0 |\n",
"| dimorphic hemorrhoids | 1.0 | 1.0 | 1 | 17.0 |\n",
"| drug reaction | 0.8333333333333334 | 0.9375 | 0.882353 | 16.0 |\n",
"| fungal infection | 1.0 | 1.0 | 1 | 18.0 |\n",
"| gastroesophageal reflux disease | 0.8461538461538461 | 1.0 | 0.916667 | 22.0 |\n",
"| hypertension | 0.9473684210526315 | 1.0 | 0.972973 | 18.0 |\n",
"| impetigo | 1.0 | 0.96 | 0.979592 | 25.0 |\n",
"| jaundice | 1.0 | 1.0 | 1 | 17.0 |\n",
"| malaria | 1.0 | 1.0 | 1 | 23.0 |\n",
"| migraine | 1.0 | 0.8947368421052632 | 0.944444 | 19.0 |\n",
"| peptic ulcer disease | 1.0 | 0.8181818181818182 | 0.9 | 22.0 |\n",
"| pneumonia | 1.0 | 0.9166666666666666 | 0.956522 | 24.0 |\n",
"| psoriasis | 1.0 | 0.9545454545454546 | 0.976744 | 22.0 |\n",
"| typhoid | 1.0 | 0.7916666666666666 | 0.883721 | 24.0 |\n",
"| urinary tract infection | 0.8888888888888888 | 1.0 | 0.941176 | 16.0 |\n",
"| varicose veins | 1.0 | 0.9411764705882353 | 0.969697 | 17.0 |\n",
"| accuracy | | | 0.928571 | |\n",
"| macro avg | 0.9328503826337484 | 0.9311159941781071 | 0.927117 | |\n",
"| weighted avg | 0.9397250222168541 | 0.9285714285714286 | 0.929384 | |\n",
"+---------------------------------+--------------------+--------------------+------------+-----------+\n"
]
}
],
"source": [
"source": [
"evaluate_method(lemmatize_text_stanza)"
"evaluate_method(lemmatize_text_stanza)"
]
]
...
@@ -365,7 +412,7 @@
...
@@ -365,7 +412,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 1
6
,
"execution_count": 1
7
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment