Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,8 @@ import io
|
|
| 9 |
import requests
|
| 10 |
import json
|
| 11 |
import openai
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# File upload size bug?
|
| 14 |
|
|
@@ -90,6 +92,10 @@ if st.button('Start Transcription'):
|
|
| 90 |
|
| 91 |
with st.expander("See transcript"):
|
| 92 |
st.markdown(transcript)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
# Update the user input field with the transcription
|
| 95 |
st.session_state.userinput = st.text_area("Input Text:", transcript)
|
|
@@ -150,9 +156,10 @@ if st.session_state.userinput and api_key and st.button("Extract Claims", key="c
|
|
| 150 |
|
| 151 |
# Get the extracted claims from Streamlit's session state
|
| 152 |
claims_extracted = st.session_state.claims_extraction
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
|
|
|
| 156 |
|
| 157 |
# Define the BERT-based model name
|
| 158 |
model_name = 'nlpaueb/legal-bert-base-uncased'
|
|
@@ -190,22 +197,11 @@ for i, summary in enumerate(summaries):
|
|
| 190 |
st.write(f"### Summary {i+1}")
|
| 191 |
st.write(summary)
|
| 192 |
|
| 193 |
-
# Display the
|
| 194 |
-
if
|
| 195 |
-
st.text("
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
st.text("Transcription:")
|
| 199 |
-
st.text(transcript)
|
| 200 |
-
|
| 201 |
-
if 'claims_extracted' in st.session_state:
|
| 202 |
-
st.text("Extracted Claims:")
|
| 203 |
-
st.text(st.session_state.claims_extracted)
|
| 204 |
-
|
| 205 |
-
if summaries:
|
| 206 |
-
st.text("BERT Summaries:")
|
| 207 |
-
for i, summary in enumerate(summaries):
|
| 208 |
-
st.text(f"Summary {i + 1}:\n{summary}")
|
| 209 |
|
| 210 |
# Citation for the GitHub repo
|
| 211 |
st.markdown("<sub>This app was created by [Tonic](https://huggingface.co/tonic) with help from [MIND INTERFACES](https://huggingface.co/MIND-INTERFACES) & (Taylor)[https://huggingface.co/Cloudfaith] [join us on discord](https://discord.gg/5RmtZVVfgQ) </sub>", unsafe_allow_html=True)
|
|
|
|
| 9 |
import requests
|
| 10 |
import json
|
| 11 |
import openai
|
| 12 |
+
from transformers import AutoConfig, AutoTokenizer, AutoModel
|
| 13 |
+
from summarizer import Summarizer
|
| 14 |
|
| 15 |
# File upload size bug?
|
| 16 |
|
|
|
|
| 92 |
|
| 93 |
with st.expander("See transcript"):
|
| 94 |
st.markdown(transcript)
|
| 95 |
+
# Display the Whisper transcription
|
| 96 |
+
if 'transcript' in locals():
|
| 97 |
+
st.text("Transcription:")
|
| 98 |
+
st.text(transcript)
|
| 99 |
|
| 100 |
# Update the user input field with the transcription
|
| 101 |
st.session_state.userinput = st.text_area("Input Text:", transcript)
|
|
|
|
| 156 |
|
| 157 |
# Get the extracted claims from Streamlit's session state
|
| 158 |
claims_extracted = st.session_state.claims_extraction
|
| 159 |
+
# Display the Extracted Claims
|
| 160 |
+
if 'claims_extracted' in st.session_state:
|
| 161 |
+
st.text("Extracted Claims:")
|
| 162 |
+
st.text(st.session_state.claims_extracted)
|
| 163 |
|
| 164 |
# Define the BERT-based model name
|
| 165 |
model_name = 'nlpaueb/legal-bert-base-uncased'
|
|
|
|
| 197 |
st.write(f"### Summary {i+1}")
|
| 198 |
st.write(summary)
|
| 199 |
|
| 200 |
+
# Display the BERT Summaries
|
| 201 |
+
if summaries:
|
| 202 |
+
st.text("BERT Summaries:")
|
| 203 |
+
for i, summary in enumerate(summaries):
|
| 204 |
+
st.text(f"Summary {i + 1}:\n{summary}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
|
| 206 |
# Citation for the GitHub repo
|
| 207 |
st.markdown("<sub>This app was created by [Tonic](https://huggingface.co/tonic) with help from [MIND INTERFACES](https://huggingface.co/MIND-INTERFACES) & (Taylor)[https://huggingface.co/Cloudfaith] [join us on discord](https://discord.gg/5RmtZVVfgQ) </sub>", unsafe_allow_html=True)
|