|
import util |
|
import abstract |
|
import classification |
|
import inference |
|
import outline |
|
from inference import BertClassificationModel |
|
|
|
|
|
|
|
|
|
def texClear(article): |
|
sentencesCleared = [util.clean_text(sentence) for sentence in article] |
|
sentencesCleared = [string for string in sentencesCleared if string != '' ] |
|
|
|
return sentencesCleared |
|
|
|
def textToAb(sentences, article, topic_num, max_length): |
|
central_sentences = abstract.abstruct_main(sentences, topic_num) |
|
groups = classification.classify_by_topic(article, central_sentences) |
|
groups = util.article_to_group(groups, central_sentences) |
|
title_dict,title = util.generation(groups, max_length) |
|
|
|
|
|
|
|
matrix = inference.inference_matrix(title) |
|
|
|
outl,outline_list = outline.passage_outline(matrix,title) |
|
|
|
output = util.formate_text(title_dict,outline_list) |
|
|
|
return outl, output |