Spaces:
Sleeping
Sleeping
Delete ontology/app.py
Browse files- ontology/app.py +0 -22
ontology/app.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
| 1 |
-
from src.ontology_adapter import ESGOntologyAdapter
|
| 2 |
-
import gradio as gr
|
| 3 |
-
|
| 4 |
-
adapter = ESGOntologyAdapter("ontology/esg_ontology.owl")
|
| 5 |
-
|
| 6 |
-
def analyze_text(text):
|
| 7 |
-
sections = text.split("\n\n")
|
| 8 |
-
results = []
|
| 9 |
-
for s in sections:
|
| 10 |
-
mapping = adapter.map_term(s)
|
| 11 |
-
results.append(f"Section: {s[:80]}...\n→ Mapped to: {mapping['mapped_to']} (sim={mapping['similarity']:.2f})")
|
| 12 |
-
return "\n\n".join(results)
|
| 13 |
-
|
| 14 |
-
iface = gr.Interface(
|
| 15 |
-
fn=analyze_text,
|
| 16 |
-
inputs="textarea",
|
| 17 |
-
outputs="text",
|
| 18 |
-
title="ESG Ontology-Based Sentiment Mapping",
|
| 19 |
-
description="Maps document sections to ESG ontology classes using semantic similarity."
|
| 20 |
-
)
|
| 21 |
-
|
| 22 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|