自然语言处理NLP星空智能对话机器人系列:深入理解Transformer自然语言处理 Summarizing documents with T5-large
目录
Summarizing documents with T5-large
- Summarizing documents with T5-large
- Creating a summarization function
- A general topic sample
- The Bill of Rights sample
- A corporate law sample
- 星空智能对话机器人系列博客
我们将创建一个摘要函数,可以使用任何文本调用文本摘要函数,将以法律和金融方面的例子进行文本摘要,将挑战该方法的局限性。
Creating a summarization function首先, 我们创建一个名为summary的摘要函数,该函数有两个参数,第一个参数是preprocess_text,即要摘要的文本。第二个参数是ml