Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,12 +16,12 @@ def clean_text(text):
|
|
| 16 |
|
| 17 |
@st.cache_data
|
| 18 |
def load_data():
|
| 19 |
-
df = pd.read_csv("
|
| 20 |
df['status_date'] = pd.to_datetime(df['status_date'], format='%d-%m-%Y', errors='coerce')
|
| 21 |
df = df.dropna(subset=['status_date'])
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
return df
|
| 26 |
|
| 27 |
@st.cache_resource
|
|
@@ -124,8 +124,8 @@ if query:
|
|
| 124 |
description = row['description']
|
| 125 |
summary = row['summary']
|
| 126 |
|
| 127 |
-
|
| 128 |
-
|
| 129 |
|
| 130 |
st.markdown(f"**Date:** {date} | **Bill Number:** {bill_number} | **Score:** {score:.2f}")
|
| 131 |
st.markdown(f"**Category:** {cat}")
|
|
@@ -137,13 +137,13 @@ if query:
|
|
| 137 |
st.markdown(f"**Policy Impacy Area:** {impact}")
|
| 138 |
st.markdown(f"**Key Provision:** {provision}")
|
| 139 |
st.markdown(f"**Description:** {description}")
|
| 140 |
-
|
| 141 |
-
|
| 142 |
st.markdown(f"Actionable Insight:{insight}")
|
| 143 |
st.markdown(f"[View Full Bill Text]({full_url})\n")
|
| 144 |
st.divider()
|
| 145 |
|
| 146 |
-
|
| 147 |
|
| 148 |
st.subheader("RAG-Generated Overall Summary")
|
| 149 |
summary = rag_summarize(collected, summarizer)
|
|
|
|
| 16 |
|
| 17 |
@st.cache_data
|
| 18 |
def load_data():
|
| 19 |
+
df = pd.read_csv("Illinois_Standardized_Final_with_Llama.csv")
|
| 20 |
df['status_date'] = pd.to_datetime(df['status_date'], format='%d-%m-%Y', errors='coerce')
|
| 21 |
df = df.dropna(subset=['status_date'])
|
| 22 |
+
df["llama_trend_summary"] = df["llama_trend_summary"].fillna("")
|
| 23 |
+
df["llama_insight"] = df["llama_insight"].fillna("")
|
| 24 |
+
df["summary_insight"] = df["llama_trend_summary"] + "\n" + df["llama_insight"]
|
| 25 |
return df
|
| 26 |
|
| 27 |
@st.cache_resource
|
|
|
|
| 124 |
description = row['description']
|
| 125 |
summary = row['summary']
|
| 126 |
|
| 127 |
+
trend = clean_text(row['llama_trend_summary'])
|
| 128 |
+
insight = clean_text(row['llama_insight'])
|
| 129 |
|
| 130 |
st.markdown(f"**Date:** {date} | **Bill Number:** {bill_number} | **Score:** {score:.2f}")
|
| 131 |
st.markdown(f"**Category:** {cat}")
|
|
|
|
| 137 |
st.markdown(f"**Policy Impacy Area:** {impact}")
|
| 138 |
st.markdown(f"**Key Provision:** {provision}")
|
| 139 |
st.markdown(f"**Description:** {description}")
|
| 140 |
+
st.markdown(f"**Summary:** {summary}")
|
| 141 |
+
st.markdown(f"Trend Summary:{trend}")
|
| 142 |
st.markdown(f"Actionable Insight:{insight}")
|
| 143 |
st.markdown(f"[View Full Bill Text]({full_url})\n")
|
| 144 |
st.divider()
|
| 145 |
|
| 146 |
+
collected.append(row['summary_insight'])
|
| 147 |
|
| 148 |
st.subheader("RAG-Generated Overall Summary")
|
| 149 |
summary = rag_summarize(collected, summarizer)
|