MrGanesh commited on
Commit
0725e2d
Β·
1 Parent(s): 64a36e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -4,27 +4,23 @@ import pandas as pd
4
  from transformers import pipeline
5
  import streamlit as st
6
 
 
7
  def app():
8
  st.title("Text Summarization πŸ€“")
9
 
10
  st.markdown("This is a Web application that Summarizes Text 😎")
11
  text=st.text_area('Enter Text')
12
-
13
- def facebook_bart_model():
14
- summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
15
- return summarizer
16
- summarizer= facebook_bart_model()
17
-
18
- def text_summarizer(text):
19
- a = summarizer(text, max_length=450, min_length=150, do_sample=False)
20
- return a[0]['summary_text']
21
 
22
 
23
  # Check to see if a file has been uploaded
24
  if text:
25
  st.success("Summarizing Text, Please wait...")
26
  # If it has then do the following:
27
- out=text.apply(text_summarizer)
28
  st.json(out)
29
 
30
 
 
4
  from transformers import pipeline
5
  import streamlit as st
6
 
7
+
8
  def app():
9
  st.title("Text Summarization πŸ€“")
10
 
11
  st.markdown("This is a Web application that Summarizes Text 😎")
12
  text=st.text_area('Enter Text')
13
+
14
+ summarizer = pipeline("summarization", model="google/bigbird-pegasus-large-bigpatent")
15
+
16
+ pipe=summarizer(text,min_length=100, max_length=400)
 
 
 
 
 
17
 
18
 
19
  # Check to see if a file has been uploaded
20
  if text:
21
  st.success("Summarizing Text, Please wait...")
22
  # If it has then do the following:
23
+ out=pipe(text)
24
  st.json(out)
25
 
26