macrdel commited on
Commit
7338b09
1 Parent(s): 75483f2

update pipeline summarize src.py

Browse files
Files changed (1) hide show
  1. app/src/src.py +3 -3
app/src/src.py CHANGED
@@ -62,7 +62,7 @@ def pipeline_stats(data):
62
  """Get statistic of sentiment"""
63
  return data['sentiment'].value_counts(normalize=True).mul(100).round(2)
64
 
65
- def pipeline_summarize(data, headers, url, length=2000, max_length=50):
66
  """Get summarization result"""
67
  text = " ".join(data)
68
  result_text = []
@@ -76,6 +76,6 @@ def pipeline_summarize(data, headers, url, length=2000, max_length=50):
76
  }
77
  }
78
  res = requests.post(url, headers=headers, json=payload)
79
- result_text.append(res.json())
80
 
81
- return ". ".join([i[0]["generated_text"] for i in result_text])
 
62
  """Get statistic of sentiment"""
63
  return data['sentiment'].value_counts(normalize=True).mul(100).round(2)
64
 
65
+ def pipeline_summarize(data, headers, url, length=2000, max_length=35):
66
  """Get summarization result"""
67
  text = " ".join(data)
68
  result_text = []
 
76
  }
77
  }
78
  res = requests.post(url, headers=headers, json=payload)
79
+ result_text.append(res.json()[0]["generated_text"])
80
 
81
+ return ". ".join(result_text)