NLP-文本摘要:利用预训练模型进行文本摘要任务【transformers:pipeline、T5、BART、Pegasus】
一、pipeline可以使用pipeline快速实现文本摘要fromtransformersimportpipelinesummarizer=pipeline(task="summarization",model='t5-small')text="""summarize:(CNN)Forthesecondtimeduringhispapacy,PopeFrancishasannouncedanew