Update app.py
Browse files
app.py
CHANGED
|
@@ -11,16 +11,14 @@ aws_access_key = os.getenv("aws_access_key")
|
|
| 11 |
aws_secret_key = os.getenv("aws_secret_key")
|
| 12 |
s3 = boto3.client('s3', aws_access_key_id=aws_access_key, aws_secret_access_key=aws_secret_key)
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
st.set_page_config(layout="wide")
|
| 19 |
|
| 20 |
justices_response = s3.get_object(Bucket='gideon-corpus', Key='Justices Table.csv')
|
| 21 |
justices_df = pd.read_csv(justices_response['Body'])
|
| 22 |
|
| 23 |
|
|
|
|
|
|
|
| 24 |
def get_subdirectories(prefix):
|
| 25 |
subdirectories = set()
|
| 26 |
paginator = s3.get_paginator('list_objects_v2')
|
|
@@ -62,13 +60,15 @@ for c in cases:
|
|
| 62 |
tabs = st.tabs(types)
|
| 63 |
for (tab, type, author_ind, text, kws) in zip(tabs, types, author_inds, texts, keywords):
|
| 64 |
with tab:
|
| 65 |
-
st.markdown("**" + justices_df.iloc[author_ind]['Name'].split(', ')[0].split(' ')[-1] + "**")
|
|
|
|
|
|
|
| 66 |
st.markdown("**Tags**: " + str(kws[0:6]))
|
| 67 |
-
|
| 68 |
|
| 69 |
|
| 70 |
-
|
| 71 |
-
# st.write(opinions_df)
|
| 72 |
st.divider()
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
|
|
|
|
| 11 |
aws_secret_key = os.getenv("aws_secret_key")
|
| 12 |
s3 = boto3.client('s3', aws_access_key_id=aws_access_key, aws_secret_access_key=aws_secret_key)
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
st.set_page_config(layout="wide")
|
| 15 |
|
| 16 |
justices_response = s3.get_object(Bucket='gideon-corpus', Key='Justices Table.csv')
|
| 17 |
justices_df = pd.read_csv(justices_response['Body'])
|
| 18 |
|
| 19 |
|
| 20 |
+
all_kws = []
|
| 21 |
+
|
| 22 |
def get_subdirectories(prefix):
|
| 23 |
subdirectories = set()
|
| 24 |
paginator = s3.get_paginator('list_objects_v2')
|
|
|
|
| 60 |
tabs = st.tabs(types)
|
| 61 |
for (tab, type, author_ind, text, kws) in zip(tabs, types, author_inds, texts, keywords):
|
| 62 |
with tab:
|
| 63 |
+
st.markdown("**" + justices_df.iloc[author_ind]['Name'].split(', ')[0].split(' ')[-1] + "**")4
|
| 64 |
+
for kw in kws:
|
| 65 |
+
all_kws.append(kw)
|
| 66 |
st.markdown("**Tags**: " + str(kws[0:6]))
|
|
|
|
| 67 |
|
| 68 |
|
|
|
|
|
|
|
| 69 |
st.divider()
|
| 70 |
+
|
| 71 |
+
all_kws = list(set(all_kws))
|
| 72 |
+
st.write(all_kws)
|
| 73 |
|
| 74 |
|