Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ from keyphrase_extraction import extract_sentences_with_obligations
|
|
12 |
dataset = load_dataset("EE21/ToS-Summaries")
|
13 |
|
14 |
# Extract titles or identifiers for the ToS
|
15 |
-
tos_titles = [
|
16 |
|
17 |
# Set page to wide mode
|
18 |
st.set_page_config(layout="wide")
|
@@ -64,8 +64,7 @@ def main():
|
|
64 |
st.write("PDF uploaded successfully.")
|
65 |
elif user_input:
|
66 |
file_content = user_input
|
67 |
-
elif tos_selection_index
|
68 |
-
tos_selection_index = tos_titles.index(tos_titles) - 1 # Adjust for the added 'None' option
|
69 |
file_content = dataset['train'][tos_selection_index]['plain_text']
|
70 |
else:
|
71 |
st.warning("Please upload a PDF, enter some text, or select a document to summarize.")
|
|
|
12 |
dataset = load_dataset("EE21/ToS-Summaries")
|
13 |
|
14 |
# Extract titles or identifiers for the ToS
|
15 |
+
tos_titles = [f"Document {i}" for i in range(len(dataset['train']))]
|
16 |
|
17 |
# Set page to wide mode
|
18 |
st.set_page_config(layout="wide")
|
|
|
64 |
st.write("PDF uploaded successfully.")
|
65 |
elif user_input:
|
66 |
file_content = user_input
|
67 |
+
elif tos_selection_index is not None:
|
|
|
68 |
file_content = dataset['train'][tos_selection_index]['plain_text']
|
69 |
else:
|
70 |
st.warning("Please upload a PDF, enter some text, or select a document to summarize.")
|