Eunchan Lee commited on
Commit
2df3a81
1 Parent(s): 8a105f5
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -25,7 +25,7 @@ BART: 60 sec 정도
25
  Pegasus:
26
 
27
  '''
28
- plms =["facebook/bart-large-cnn", "google/pegasus-xsum", "t5-base" ]
29
 
30
 
31
  st.write("Information")
@@ -33,7 +33,6 @@ st.write("__Inputs__: Text your input article!!")
33
  st.write("__Outputs__: Summarizing output text by State-of-the-art NLP summarization Models! ")
34
 
35
 
36
-
37
  def load_plms(model_name):
38
  #model_name = "google/pegasus-xsum"
39
  summarizer = pipeline(task="summarization", model=model_name)
@@ -58,7 +57,9 @@ with st.spinner('Loading Pretrained Models (_please allow for 30 seconds_)...'):
58
  summarizer_1 = load_plms(plms[0])
59
  summarizer_2 = load_plms(plms[1])
60
  summarizer_3 = load_plms(plms[2])
61
-
 
 
62
 
63
  with st.form(key="input_area"):
64
  display_text = ARTICLE + "\n\n"
@@ -72,13 +73,13 @@ output_text = []
72
  if submit_button:
73
  with st.spinner('On summarizing !...wait a second please..'):
74
  output_text.append(get_summarizer(summarizer_1, text_input, 150, 5))
75
- #output_text.append(get_summarizer(summarizer_2, text_input, 150, 5))
76
  #output_text.append(get_summarizer(summarizer_3, text_input, 150, 5))
77
 
78
 
79
  st.markdown("### Outputs are here !: ")
80
 
81
- for i in range(1):
82
  st.markdown("**"+ plms[i] +"s Output: ** ")
83
  st.text(output_text[i])
84
  st.success(f"{i+1} of 3 are done!")
 
25
  Pegasus:
26
 
27
  '''
28
+ plms =["facebook/bart-large-cnn", "google/pegasus-xsum", "t5-small" ]
29
 
30
 
31
  st.write("Information")
 
33
  st.write("__Outputs__: Summarizing output text by State-of-the-art NLP summarization Models! ")
34
 
35
 
 
36
  def load_plms(model_name):
37
  #model_name = "google/pegasus-xsum"
38
  summarizer = pipeline(task="summarization", model=model_name)
 
57
  summarizer_1 = load_plms(plms[0])
58
  summarizer_2 = load_plms(plms[1])
59
  summarizer_3 = load_plms(plms[2])
60
+ classifier = pipeline("zero-shot-classification",
61
+ model="facebook/bart-large-mnli")
62
+
63
 
64
  with st.form(key="input_area"):
65
  display_text = ARTICLE + "\n\n"
 
73
  if submit_button:
74
  with st.spinner('On summarizing !...wait a second please..'):
75
  output_text.append(get_summarizer(summarizer_1, text_input, 150, 5))
76
+ output_text.append(get_summarizer(summarizer_2, text_input, 150, 5))
77
  #output_text.append(get_summarizer(summarizer_3, text_input, 150, 5))
78
 
79
 
80
  st.markdown("### Outputs are here !: ")
81
 
82
+ for i in range(2):
83
  st.markdown("**"+ plms[i] +"s Output: ** ")
84
  st.text(output_text[i])
85
  st.success(f"{i+1} of 3 are done!")