Spaces:
Sleeping
Sleeping
Commit
•
9b8f01f
0
Parent(s):
Duplicate from alibidaran/Symptom2Disease
Browse filesCo-authored-by: Ali Bidaran <alibidaran@users.noreply.huggingface.co>
- .gitattributes +34 -0
- README.md +14 -0
- app.py +35 -0
- requirements.txt +2 -0
.gitattributes
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Symptom2Disease
|
3 |
+
emoji: 🏢
|
4 |
+
colorFrom: red
|
5 |
+
colorTo: red
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.32.0
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
license: apache-2.0
|
11 |
+
duplicated_from: alibidaran/Symptom2Disease
|
12 |
+
---
|
13 |
+
|
14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
pipe=pipeline('sentiment-analysis','alibidaran/Symptom2disease')
|
4 |
+
label_2id={'Psoriasis': 0,
|
5 |
+
'Varicose Veins': 1,
|
6 |
+
'Typhoid': 2,
|
7 |
+
'Chicken pox': 3,
|
8 |
+
'Impetigo': 4,
|
9 |
+
'Dengue': 5,
|
10 |
+
'Fungal infection': 6,
|
11 |
+
'Common Cold': 7,
|
12 |
+
'Pneumonia': 8,
|
13 |
+
'Dimorphic Hemorrhoids': 9,
|
14 |
+
'Arthritis': 10,
|
15 |
+
'Acne': 11,
|
16 |
+
'Bronchial Asthma': 12,
|
17 |
+
'Hypertension': 13,
|
18 |
+
'Migraine': 14,
|
19 |
+
'Cervical spondylosis': 15,
|
20 |
+
'Jaundice': 16,
|
21 |
+
'Malaria': 17,
|
22 |
+
'urinary tract infection': 18,
|
23 |
+
'allergy': 19,
|
24 |
+
'gastroesophageal reflux disease': 20,
|
25 |
+
'drug reaction': 21,
|
26 |
+
'peptic ulcer disease': 22,
|
27 |
+
'diabetes': 23}
|
28 |
+
id2_label={f'LABEL_{i}':v for v,i in label_2id.items()}
|
29 |
+
def detect_symptom(symptoms):
|
30 |
+
output=pipe(symptoms)[0]
|
31 |
+
label=id2_label[output['label']]
|
32 |
+
return f"You have {label} disease."
|
33 |
+
|
34 |
+
demo=gr.Interface(fn=detect_symptom,inputs='text',outputs='label')
|
35 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
torch
|
2 |
+
transformers
|