tommasobaldi commited on
Commit
42780ef
1 Parent(s): b9f5a52

working on text splitting

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -97,15 +97,15 @@ def main() -> None:
97
  split_token_length=1024
98
  )
99
  for sentence in sentences:
100
- token_list = [token for token in nltk.word_tokenize(sentence)]
101
- st.markdown(sentence)
102
- st.markdown(str(len(token_list)))
103
- # output = pipe(sentence)
104
- # summary = output[0]["summary_text"]
105
- # for line in summary.split("."):
106
- # if line != "":
107
- # summary_sentences.append(line)
108
- # display_summary(summary_sentences)
109
 
110
 
111
  if __name__ == "__main__":
 
97
  split_token_length=1024
98
  )
99
  for sentence in sentences:
100
+ # token_list = [token for token in nltk.word_tokenize(sentence)]
101
+ # st.markdown(sentence)
102
+ # st.markdown(str(len(token_list)))
103
+ output = pipe(sentence)
104
+ summary = output[0]["summary_text"]
105
+ for line in summary.split("."):
106
+ if line != "":
107
+ summary_sentences.append(line)
108
+ display_summary(summary_sentences)
109
 
110
 
111
  if __name__ == "__main__":