Update app.py
Browse files
app.py
CHANGED
|
@@ -18,13 +18,6 @@ model = SentenceTransformer('all-mpnet-base-v2')
|
|
| 18 |
|
| 19 |
st.set_page_config(layout="wide")
|
| 20 |
|
| 21 |
-
logs_response = s3.get_object(Bucket='gideon-corpus', Key='logs/logs.csv')
|
| 22 |
-
logs_df = pd.read_csv(logs_response['Body'])
|
| 23 |
-
logs_df['Last Upload'] = pd.to_datetime(logs_df['Last Upload'], unit='s')
|
| 24 |
-
|
| 25 |
-
processed = len(logs_df) - len(logs_df[logs_df['Last Upload'].isna()])
|
| 26 |
-
st.metric(label="Num Processed Cases", value=processed)
|
| 27 |
-
st.divider()
|
| 28 |
|
| 29 |
|
| 30 |
def search_index(query):
|
|
@@ -41,7 +34,9 @@ def search_index(query):
|
|
| 41 |
search = st.text_input('Search', placeholder='First Amendment cannot protect libel')
|
| 42 |
if search != "":
|
| 43 |
res = search_index(query=search)
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
|
|
|
|
| 18 |
|
| 19 |
st.set_page_config(layout="wide")
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
def search_index(query):
|
|
|
|
| 34 |
search = st.text_input('Search', placeholder='First Amendment cannot protect libel')
|
| 35 |
if search != "":
|
| 36 |
res = search_index(query=search)
|
| 37 |
+
for m in res:
|
| 38 |
+
st.write(m['metadata']['text'])
|
| 39 |
+
# st.write(res)
|
| 40 |
|
| 41 |
|
| 42 |
|