ck46 commited on
Commit
c7a8d6b
1 Parent(s): 80082f1

added diversity to key sentence extraction

Browse files
Files changed (2) hide show
  1. .gitignore +1 -0
  2. app.py +4 -2
.gitignore ADDED
@@ -0,0 +1 @@
 
1
+ /__pycache__/
app.py CHANGED
@@ -11,9 +11,11 @@ paraphraser = ParaphraseModel()
11
  # ('T5-base', 'DistilT5-base', 'T5-small')
12
  #)
13
 
 
 
14
 
15
- top_k = st.sidebar.slider('Top_K', 100, 300, 168)
16
 
 
17
  top_p = st.sidebar.slider('Top_P', 0.0, 1.0, 0.95)
18
 
19
  st.header("Bullet-point Summarization")
@@ -22,7 +24,7 @@ st.header("Bullet-point Summarization")
22
  txt = st.text_area('Text to analyze', )
23
 
24
  if len(txt) >= 1:
25
- key_sentences = get_key_sentences(txt)
26
  sentences = []
27
  for i in sorted(key_sentences):
28
  sentences.append(key_sentences[i])
11
  # ('T5-base', 'DistilT5-base', 'T5-small')
12
  #)
13
 
14
+ top_n = st.sidebar.slider('Top_n', 1, 20, 5)
15
+ diversity = st.sidebar.slider('Diversity', 0.0, 1.0, 0.6)
16
 
 
17
 
18
+ top_k = st.sidebar.slider('Top_K', 100, 300, 168)
19
  top_p = st.sidebar.slider('Top_P', 0.0, 1.0, 0.95)
20
 
21
  st.header("Bullet-point Summarization")
24
  txt = st.text_area('Text to analyze', )
25
 
26
  if len(txt) >= 1:
27
+ key_sentences = get_key_sentences(txt, top_n=top_n, diversity=('mmr', diversity))
28
  sentences = []
29
  for i in sorted(key_sentences):
30
  sentences.append(key_sentences[i])