Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,51 +30,42 @@ def log_demo_usage(text, num_entities):
|
|
30 |
|
31 |
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
gr.
|
39 |
-
""
|
40 |
-
|
41 |
-
|
42 |
-
)
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
],
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
# Footer/Disclaimer section
|
70 |
-
gr.Markdown(
|
71 |
-
"""
|
72 |
-
---
|
73 |
-
### Disclaimer
|
74 |
-
This is a **demo model** provided for educational purposes. It was trained on a limited dataset and is not intended for production use, clinical decision-making, or real-world medical applications.
|
75 |
-
"""
|
76 |
-
)
|
77 |
-
|
78 |
|
79 |
|
80 |
# Add marketing elements
|
|
|
30 |
|
31 |
|
32 |
|
33 |
+
# Define the main demo interface
|
34 |
+
|
35 |
+
|
36 |
+
demo = gr.Interface(
|
37 |
+
fn=process_text,
|
38 |
+
inputs=gr.Textbox(
|
39 |
+
label="Paste French medical text",
|
40 |
+
placeholder="Le patient présente une hypertension artérielle...",
|
41 |
+
lines=5
|
42 |
+
),
|
43 |
+
outputs=gr.HighlightedText(),
|
44 |
+
#outputs=gr.HTML(label="Identified Medical Entities"),
|
45 |
+
title="French Healthcare NER Demo",
|
46 |
+
description="""
|
47 |
+
_By **Hicham Assoudi** – AI Researcher (Ph.D.), Oracle Consultant, and Author._
|
48 |
+
---
|
49 |
+
As featured in _Natural Language Processing on Oracle Cloud Infrastructure: Building Transformer-Based NLP Solutions Using Oracle AI and Hugging Face_. [Get the Book](https://a.co/d/eg7my5G)
|
50 |
+
🔬 **Live Demo**: Demonstration of the French Healthcare NER model from Chapter 6 of the book.
|
51 |
+
📚 **Educational Focus**: Step-by-step guidance on model building, from design to deployment.
|
52 |
+
🏥 **Applications**: Healthcare NLP for text analysis, clinical studies, and compliance.
|
53 |
+
⚡ **Built on OCI**: Trained using Oracle Cloud Infrastructure's AI capabilities.
|
54 |
+
""",
|
55 |
+
article="""
|
56 |
+
### **Disclaimer**
|
57 |
+
This is a **demo model** provided for educational purposes. It was trained on a limited dataset and is not intended for production use, clinical decision-making, or real-world medical applications.
|
58 |
+
""",
|
59 |
+
examples=[
|
60 |
+
["Le medecin donne des antibiotiques en cas d'infections des voies respiratoires e.g. pneumonie."],
|
61 |
+
["Dans le cas de l'asthme, le médecin peut recommander des corticoïdes pour réduire l'inflammation dans les poumons."],
|
62 |
+
["Pour soulager les symptômes d'allergie, le médecin prescrit des antihistaminiques."],
|
63 |
+
["Si le patient souffre de diabète de type 2, le médecin peut prescrire une insulinothérapie par exemple: Metformine 500mg."],
|
64 |
+
["Après une blessure musculaire ou une maladies douloureuses des tendons comme une tendinopathie, le patient pourrait suivre une kinésithérapie ou une physiothérapie."],
|
65 |
+
["En cas d'infection bactérienne, le médecin recommande une antibiothérapie."],
|
66 |
+
["Antécédents: infarctus du myocarde en 2019. Allergie à la pénicilline."]
|
67 |
+
]
|
68 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
|
71 |
# Add marketing elements
|