domro11 commited on
Commit
3229f04
·
1 Parent(s): dcc0fda

update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -74,16 +74,17 @@ def main():
74
 
75
  if raw_text!="" and num_words is not None:
76
  num_words = int(num_words)
77
- summarizer = pipeline('summarization')
78
  summary = summarizer(raw_text, min_length=num_words,max_length=50)
79
  s1 = json.dumps(summary[0])
80
  d2 = json.loads(s1)
81
  result_summary = d2['summary_text']
82
  result_summary = '. '.join(list(map(lambda x: x.strip().capitalize(), result_summary.split('.'))))
83
- st.write(f"Here's your Summary : {result_summary}")
84
-
85
-
86
-
 
87
  elif choice=="Sentiment Analysis":
88
  st.subheader("Sentiment Analysis")
89
  #loading the pipeline
 
74
 
75
  if raw_text!="" and num_words is not None:
76
  num_words = int(num_words)
77
+ summarizer = pipeline('summarization',model="philschmid/bart-large-cnn-samsum")
78
  summary = summarizer(raw_text, min_length=num_words,max_length=50)
79
  s1 = json.dumps(summary[0])
80
  d2 = json.loads(s1)
81
  result_summary = d2['summary_text']
82
  result_summary = '. '.join(list(map(lambda x: x.strip().capitalize(), result_summary.split('.'))))
83
+ st.write(f"Here's your Summary : {result_summary}")
84
+
85
+
86
+
87
+
88
  elif choice=="Sentiment Analysis":
89
  st.subheader("Sentiment Analysis")
90
  #loading the pipeline