Commit
·
bd6f02f
1
Parent(s):
9603f8e
V1.1 RSE
Browse files
app.py
CHANGED
|
@@ -36,9 +36,23 @@ def display_organisations_engagees():
|
|
| 36 |
|
| 37 |
# Fonction pour l'onglet "GeoRSE Insights"
|
| 38 |
def display_geo_rse_insights():
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
#
|
| 42 |
def classify_rse_actions(descriptions):
|
| 43 |
classifier = pipeline("zero-shot-classification", model="typeform/distilbert-base-uncased-mnli")
|
| 44 |
categories = [
|
|
@@ -62,14 +76,12 @@ def classify_rse_actions(descriptions):
|
|
| 62 |
# Nouvelle fonction pour l'onglet de classification RSE
|
| 63 |
def display_rse_categorizer():
|
| 64 |
st.header("Classification des Actions RSE")
|
| 65 |
-
st.write("
|
| 66 |
|
| 67 |
data, _ = get_data()
|
| 68 |
if data:
|
| 69 |
descriptions = [item['action_rse'] for item in data if 'action_rse' in item]
|
| 70 |
categories = classify_rse_actions(descriptions)
|
| 71 |
-
|
| 72 |
-
# Affichage des résultats
|
| 73 |
for i, category in enumerate(categories):
|
| 74 |
st.write(f"Action RSE: {descriptions[i]}")
|
| 75 |
st.write(f"Catégorie prédite: {category}")
|
|
|
|
| 36 |
|
| 37 |
# Fonction pour l'onglet "GeoRSE Insights"
|
| 38 |
def display_geo_rse_insights():
|
| 39 |
+
data, _ = get_data()
|
| 40 |
+
if data:
|
| 41 |
+
m = folium.Map(location=[44.84474, -0.60711], zoom_start=11)
|
| 42 |
+
for item in data:
|
| 43 |
+
point_geo = item.get('point_geo', [])
|
| 44 |
+
if point_geo:
|
| 45 |
+
lat, lon = point_geo
|
| 46 |
+
lat, lon = float(lat), float(lon)
|
| 47 |
+
if lat and lon:
|
| 48 |
+
folium.Marker(
|
| 49 |
+
[lat, lon],
|
| 50 |
+
popup=f"<b>{item.get('nom_courant_denomination', 'Sans nom')}</b><br>Action RSE: {item.get('action_rse', 'Non spécifié')}",
|
| 51 |
+
icon=folium.Icon(color="green", icon="leaf"),
|
| 52 |
+
).add_to(m)
|
| 53 |
+
folium_static(m)
|
| 54 |
|
| 55 |
+
# Fonction pour la classification des actions RSE
|
| 56 |
def classify_rse_actions(descriptions):
|
| 57 |
classifier = pipeline("zero-shot-classification", model="typeform/distilbert-base-uncased-mnli")
|
| 58 |
categories = [
|
|
|
|
| 76 |
# Nouvelle fonction pour l'onglet de classification RSE
|
| 77 |
def display_rse_categorizer():
|
| 78 |
st.header("Classification des Actions RSE")
|
| 79 |
+
st.write("Cet outil classe les actions RSE des entreprises selon les normes ISO 26000.")
|
| 80 |
|
| 81 |
data, _ = get_data()
|
| 82 |
if data:
|
| 83 |
descriptions = [item['action_rse'] for item in data if 'action_rse' in item]
|
| 84 |
categories = classify_rse_actions(descriptions)
|
|
|
|
|
|
|
| 85 |
for i, category in enumerate(categories):
|
| 86 |
st.write(f"Action RSE: {descriptions[i]}")
|
| 87 |
st.write(f"Catégorie prédite: {category}")
|