Commit 7f83dc75 authored by Almouhannad Hafez's avatar Almouhannad Hafez

(3) Add stanza output to lemmatizer

parent ba4e54ec
......@@ -96,8 +96,8 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2024-11-02 21:15:19 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 WARNING: Language en package default expects mwt, which has been added\n",
"2024-11-02 21:57:37 INFO: Loading these models for language: en (English):\n",
"=================================\n",
"| Processor | Package |\n",
"---------------------------------\n",
......@@ -107,12 +107,12 @@
"| lemma | combined_nocharlm |\n",
"=================================\n",
"\n",
"2024-11-02 21:15:19 INFO: Using device: cpu\n",
"2024-11-02 21:15:19 INFO: Loading: tokenize\n",
"2024-11-02 21:15:21 INFO: Loading: mwt\n",
"2024-11-02 21:15:21 INFO: Loading: pos\n",
"2024-11-02 21:15:22 INFO: Loading: lemma\n",
"2024-11-02 21:15:22 INFO: Done loading processors!\n"
"2024-11-02 21:57:37 INFO: Using device: cpu\n",
"2024-11-02 21:57:37 INFO: Loading: tokenize\n",
"2024-11-02 21:57:38 INFO: Loading: mwt\n",
"2024-11-02 21:57:38 INFO: Loading: pos\n",
"2024-11-02 21:57:38 INFO: Loading: lemma\n",
"2024-11-02 21:57:38 INFO: Done loading processors!\n"
]
}
],
......@@ -347,11 +347,58 @@
"# ***2- Stanza lemmatizer***"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**42 minutes to execute!**"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"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": [
"evaluate_method(lemmatize_text_stanza)"
]
......@@ -365,7 +412,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"outputs": [
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment