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
55058799
Commit
55058799
authored
Nov 02, 2024
by
Mariam.Kherbek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(3) Edit on N-grams
parent
01b469f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
1 deletion
+107
-1
3.3.N-Grams.ipynb
3.3.N-Grams.ipynb
+98
-0
README.md
README.md
+9
-1
constants.cpython-312.pyc
__pycache__/constants.cpython-312.pyc
+0
-0
No files found.
3.3.N-Grams.ipynb
View file @
55058799
...
...
@@ -276,6 +276,104 @@
"evaluate_method(3)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Train Accuracy: 1.0\n",
"Test Accuracy: 0.8008658008658008\n",
"+---------------------------------+--------------------+--------------------+------------+-----------+\n",
"| Class | Precision | Recall | F1-score | Support |\n",
"|---------------------------------+--------------------+--------------------+------------+-----------|\n",
"| acne | 0.9473684210526315 | 0.9473684210526315 | 0.947368 | 19.0 |\n",
"| allergy | 0.7777777777777778 | 0.7368421052631579 | 0.756757 | 19.0 |\n",
"| arthritis | 0.7368421052631579 | 1.0 | 0.848485 | 14.0 |\n",
"| bronchial asthma | 0.5714285714285714 | 0.9411764705882353 | 0.711111 | 17.0 |\n",
"| cervical spondylosis | 1.0 | 1.0 | 1 | 21.0 |\n",
"| chicken pox | 0.5789473684210527 | 0.5789473684210527 | 0.578947 | 19.0 |\n",
"| common cold | 0.7777777777777778 | 0.7777777777777778 | 0.777778 | 18.0 |\n",
"| dengue | 0.2765957446808511 | 0.8125 | 0.412698 | 16.0 |\n",
"| diabetes | 1.0 | 0.5789473684210527 | 0.733333 | 19.0 |\n",
"| dimorphic hemorrhoids | 0.8947368421052632 | 1.0 | 0.944444 | 17.0 |\n",
"| drug reaction | 0.631578947368421 | 0.75 | 0.685714 | 16.0 |\n",
"| fungal infection | 0.9473684210526315 | 1.0 | 0.972973 | 18.0 |\n",
"| gastroesophageal reflux disease | 0.9333333333333333 | 0.6363636363636364 | 0.756757 | 22.0 |\n",
"| hypertension | 0.8947368421052632 | 0.9444444444444444 | 0.918919 | 18.0 |\n",
"| impetigo | 1.0 | 0.72 | 0.837209 | 25.0 |\n",
"| jaundice | 0.9444444444444444 | 1.0 | 0.971429 | 17.0 |\n",
"| malaria | 1.0 | 0.8695652173913043 | 0.930233 | 23.0 |\n",
"| migraine | 0.9444444444444444 | 0.8947368421052632 | 0.918919 | 19.0 |\n",
"| peptic ulcer disease | 0.9166666666666666 | 0.5 | 0.647059 | 22.0 |\n",
"| pneumonia | 1.0 | 0.7083333333333334 | 0.829268 | 24.0 |\n",
"| psoriasis | 0.9473684210526315 | 0.8181818181818182 | 0.878049 | 22.0 |\n",
"| typhoid | 1.0 | 0.4583333333333333 | 0.628571 | 24.0 |\n",
"| urinary tract infection | 0.7 | 0.875 | 0.777778 | 16.0 |\n",
"| varicose veins | 0.9444444444444444 | 1.0 | 0.971429 | 17.0 |\n",
"| accuracy | | | 0.800866 | |\n",
"| macro avg | 0.8485775238924734 | 0.8145215890282099 | 0.809801 | |\n",
"| weighted avg | 0.8647288526187902 | 0.8008658008658008 | 0.810413 | |\n",
"+---------------------------------+--------------------+--------------------+------------+-----------+\n"
]
}
],
"source": [
"evaluate_method(4)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Train Accuracy: 1.0\n",
"Test Accuracy: 0.7077922077922078\n",
"+---------------------------------+---------------------+---------------------+------------+-----------+\n",
"| Class | Precision | Recall | F1-score | Support |\n",
"|---------------------------------+---------------------+---------------------+------------+-----------|\n",
"| acne | 0.9 | 0.9473684210526315 | 0.923077 | 19.0 |\n",
"| allergy | 0.7692307692307693 | 0.5263157894736842 | 0.625 | 19.0 |\n",
"| arthritis | 0.7647058823529411 | 0.9285714285714286 | 0.83871 | 14.0 |\n",
"| bronchial asthma | 0.6521739130434783 | 0.8823529411764706 | 0.75 | 17.0 |\n",
"| cervical spondylosis | 0.9545454545454546 | 1.0 | 0.976744 | 21.0 |\n",
"| chicken pox | 0.45 | 0.47368421052631576 | 0.461538 | 19.0 |\n",
"| common cold | 0.8666666666666667 | 0.7222222222222222 | 0.787879 | 18.0 |\n",
"| dengue | 0.16091954022988506 | 0.875 | 0.271845 | 16.0 |\n",
"| diabetes | 1.0 | 0.5263157894736842 | 0.689655 | 19.0 |\n",
"| dimorphic hemorrhoids | 0.9411764705882353 | 0.9411764705882353 | 0.941176 | 17.0 |\n",
"| drug reaction | 0.2857142857142857 | 0.5 | 0.363636 | 16.0 |\n",
"| fungal infection | 0.9 | 1.0 | 0.947368 | 18.0 |\n",
"| gastroesophageal reflux disease | 1.0 | 0.5909090909090909 | 0.742857 | 22.0 |\n",
"| hypertension | 0.8421052631578947 | 0.8888888888888888 | 0.864865 | 18.0 |\n",
"| impetigo | 1.0 | 0.28 | 0.4375 | 25.0 |\n",
"| jaundice | 0.9444444444444444 | 1.0 | 0.971429 | 17.0 |\n",
"| malaria | 1.0 | 0.8695652173913043 | 0.930233 | 23.0 |\n",
"| migraine | 1.0 | 0.7894736842105263 | 0.882353 | 19.0 |\n",
"| peptic ulcer disease | 1.0 | 0.45454545454545453 | 0.625 | 22.0 |\n",
"| pneumonia | 1.0 | 0.7083333333333334 | 0.829268 | 24.0 |\n",
"| psoriasis | 0.875 | 0.6363636363636364 | 0.736842 | 22.0 |\n",
"| typhoid | 1.0 | 0.375 | 0.545455 | 24.0 |\n",
"| urinary tract infection | 0.9 | 0.5625 | 0.692308 | 16.0 |\n",
"| varicose veins | 0.9375 | 0.8823529411764706 | 0.909091 | 17.0 |\n",
"| accuracy | | | 0.707792 | |\n",
"| macro avg | 0.8393409454155857 | 0.723372479995974 | 0.739326 | |\n",
"| weighted avg | 0.8568198474957226 | 0.7077922077922078 | 0.737445 | |\n",
"+---------------------------------+---------------------+---------------------+------------+-----------+\n"
]
}
],
"source": [
"evaluate_method(5)"
]
},
{
"cell_type": "code",
"execution_count": null,
...
...
README.md
View file @
55058799
...
...
@@ -70,4 +70,12 @@
-
**Applying classification task using POS tagger to perform task using only one tag, this includes:**
1.
Testing
***Verbs**
*
only
1.
Testing
***Adjectives**
*
only
1.
Testing
***Nouns**
*
only
\ No newline at end of file
1.
Testing
***Nouns**
*
only
**`3.3.N-Grams.ipynb`**
-
**Applying classification task using n-gram to perform task using only TF-IDF with different grams, this includes:**
1.
`1-Gram`
1.
`2-Gram`
1.
`3-Gram`
1.
`4-Gram`
1.
`5-Gram`
\ No newline at end of file
__pycache__/constants.cpython-312.pyc
0 → 100644
View file @
55058799
File added
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