UNIST-Eunchan commited on
Commit
05195f8
β€’
1 Parent(s): f7c77c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -95,6 +95,9 @@ _book = test_book[book_index]['book'][:10000]
95
  st.title("Book Summarization πŸ“š")
96
  st.write("Book Summarization using BART-BOOK! ")
97
  #book_index = st.sidebar.slider("Select Book Example", value = 0,min_value = 0, max_value=4)
 
 
 
98
  sent = st.text_area("Text", _book, height = 1500)
99
  max_length = st.sidebar.slider("Max Length", value = 512,min_value = 10, max_value=1024)
100
  temperature = st.sidebar.slider("Temperature", value = 1.0, min_value = 0.0, max_value=1.0, step=0.05)
@@ -139,4 +142,7 @@ for i in range(10):
139
 
140
  summaries = generate_output(chunked_segments[i])
141
  st.write(f'A summary of Segment {i}.')
 
 
 
142
  st.success(summaries[-1])
 
95
  st.title("Book Summarization πŸ“š")
96
  st.write("Book Summarization using BART-BOOK! ")
97
  #book_index = st.sidebar.slider("Select Book Example", value = 0,min_value = 0, max_value=4)
98
+
99
+ docu_size = len(tokenizer.tokenize(_book))
100
+ st.write(f"Document size: {docu_size} tokens")
101
  sent = st.text_area("Text", _book, height = 1500)
102
  max_length = st.sidebar.slider("Max Length", value = 512,min_value = 10, max_value=1024)
103
  temperature = st.sidebar.slider("Temperature", value = 1.0, min_value = 0.0, max_value=1.0, step=0.05)
 
142
 
143
  summaries = generate_output(chunked_segments[i])
144
  st.write(f'A summary of Segment {i}.')
145
+
146
+ chunk_size = len(tokenizer.tokenize(summaries))
147
+ st.write(f"Summary of Segment's size: {chunk_size} tokens")
148
  st.success(summaries[-1])