Cynthiaaaaaaaa commited on
Commit
ba256cb
1 Parent(s): 0106d1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,13 +4,13 @@ from transformers import pipeline
4
  # Summarization
5
  def summarization(text):
6
  text_model = pipeline("text-generation", model="ainize/bart-base-cnn")
7
- summary = text_model(text, max_length=100, do_sample=False)[0]["generated_text"]
8
  return summary
9
 
10
  # Sentiment Classification
11
  def sentiment_classification(summary):
12
  sentiment_model = pipeline("text-classification", model="wxrrrrrrr/finetunde_sentiment_analysis")
13
- result = sentiment_model(summary, max_length=100, do_sample=False)[0]['label']
14
  return result
15
 
16
  def main():
 
4
  # Summarization
5
  def summarization(text):
6
  text_model = pipeline("text-generation", model="ainize/bart-base-cnn")
7
+ summary = text_model(text, max_length=100, temperature=1.0)[0]["generated_text"]
8
  return summary
9
 
10
  # Sentiment Classification
11
  def sentiment_classification(summary):
12
  sentiment_model = pipeline("text-classification", model="wxrrrrrrr/finetunde_sentiment_analysis")
13
+ result = sentiment_model(summary, max_length=100, truncation=True)[0]['label']
14
  return result
15
 
16
  def main():