Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,5 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
# import cv2
|
| 3 |
-
# import Scraper
|
| 4 |
-
# import Manager
|
| 5 |
-
# import ImageProcessor
|
| 6 |
-
# import TextProcessor
|
| 7 |
-
# import Tagger
|
| 8 |
-
# import Parser
|
| 9 |
import os
|
| 10 |
-
# import pickle
|
| 11 |
from bs4 import BeautifulSoup
|
| 12 |
import requests
|
| 13 |
# import shutil
|
|
@@ -78,59 +70,5 @@ for c in cases:
|
|
| 78 |
|
| 79 |
# st.write(opinions_df)
|
| 80 |
st.divider()
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
# volume = st.slider('Volume', 500, 550, 525)
|
| 86 |
-
# r = requests.get('https://www.loc.gov/collections/united-states-reports/?fa=partof%3Au.s.+reports%3A+volume+'+str(volume) +'&st=list&c=250')
|
| 87 |
-
# soup = BeautifulSoup(r.text)
|
| 88 |
-
# html_links = soup.findAll('link',attrs={'rel': 'alternate'})
|
| 89 |
-
# pdf_links = []
|
| 90 |
-
# for hl in html_links:
|
| 91 |
-
# if len(hl['href'].split('/')[-1].split('.gif')[0])== 11:
|
| 92 |
-
# pdf_links.append(hl['href'].split('.gif')[0]+'.pdf')
|
| 93 |
-
# case_num = st.slider('Case Number', 0, len(pdf_links), 1, step=1)
|
| 94 |
-
# print(pdf_links)
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
# run = st.button("Run")
|
| 98 |
-
# if run:
|
| 99 |
-
# with st.spinner("Downloading"):
|
| 100 |
-
# loc_link = pdf_links[case_num]
|
| 101 |
-
# if os.path.exists('PDF Cases/Temp'):
|
| 102 |
-
# shutil.rmtree('PDF Cases/Temp')
|
| 103 |
-
# Scraper.download_loc(loc_link)
|
| 104 |
-
# ImageProcessor.process_file('PDF Cases/Temp')
|
| 105 |
-
# TextProcessor.process_file('PDF Cases/Temp')
|
| 106 |
-
# Tagger.process_file('PDF Cases/Temp', draw=True)
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
# st.header('Opinions')
|
| 110 |
-
# opinions_df = pd.read_csv('PDF Cases/Temp/opinions.csv')
|
| 111 |
-
# types = opinions_df['Type'].tolist()
|
| 112 |
-
# author_sents = opinions_df['Author Sent'].tolist()
|
| 113 |
-
# texts = opinions_df['Text'].tolist()
|
| 114 |
-
# for (t, a_s) in zip(types, author_sents):
|
| 115 |
-
# st.text(t + ":\t" + a_s)
|
| 116 |
-
|
| 117 |
-
# tabs = st.tabs(types)
|
| 118 |
-
# for (i, tab) in enumerate(tabs):
|
| 119 |
-
# with tab:
|
| 120 |
-
# paras = texts[i].split('<PARA>')
|
| 121 |
-
# t = "</div><br/><div>".join(paras)
|
| 122 |
-
# t = "<div>" + t
|
| 123 |
-
# st.markdown(t, unsafe_allow_html=True)
|
| 124 |
-
|
| 125 |
-
# st.divider()
|
| 126 |
-
|
| 127 |
-
# cols = st.columns(4)
|
| 128 |
-
# image_filenames = [f for f in os.listdir('PDF Cases/Temp') if 'processed.png' in f]
|
| 129 |
-
# for (i,f) in enumerate(image_filenames):
|
| 130 |
-
# image = cv2.imread('PDF Cases/Temp/' + str(i) + '-processed.png')
|
| 131 |
-
# with cols[i%4]:
|
| 132 |
-
# st.image(image)
|
| 133 |
-
|
| 134 |
-
|
| 135 |
|
| 136 |
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import os
|
|
|
|
| 3 |
from bs4 import BeautifulSoup
|
| 4 |
import requests
|
| 5 |
# import shutil
|
|
|
|
| 70 |
|
| 71 |
# st.write(opinions_df)
|
| 72 |
st.divider()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
|