ralate2 commited on
Commit
f2578d8
·
verified ·
1 Parent(s): 6e6d90d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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("Illinois_Standardized_Final.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,8 +124,8 @@ if query:
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,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
- # 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)
 
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)