hellopahe commited on
Commit
96f42d2
·
1 Parent(s): be53140
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -25,7 +25,7 @@ class SummaryExtractor(object):
25
 
26
  def extract(self, content: str) -> str:
27
  print(content)
28
- return str(self.text2text_genr(content, min_length=20, do_sample=False, num_return_sequences=3)[0]["generated_text"])
29
 
30
  class Tuoling_6B_extractor(object):
31
  def __init__(self):
@@ -100,7 +100,9 @@ lex = LexRank()
100
 
101
  def randeng_extract(content):
102
  sentences = lex.find_central(content)
103
- return str(list(t_randeng.extract(sentence) for sentence in sentences))
 
 
104
 
105
  # def tuoling_extract(content):
106
  # sentences = lex.find_central(content)
 
25
 
26
  def extract(self, content: str) -> str:
27
  print(content)
28
+ return str(self.text2text_genr(content, do_sample=False, num_return_sequences=3)[0]["generated_text"])
29
 
30
  class Tuoling_6B_extractor(object):
31
  def __init__(self):
 
100
 
101
  def randeng_extract(content):
102
  sentences = lex.find_central(content)
103
+ return "原文\n".join((sentence + "\n") for sentence in sentences) \
104
+ + "\n摘要\n" \
105
+ + str(list(t_randeng.extract(sentence) for sentence in sentences))
106
 
107
  # def tuoling_extract(content):
108
  # sentences = lex.find_central(content)