我试着用来自变形金刚的管道来总结文本。但我能得到的只是原始文本的截断文本。 我的代码是:
from transformers import pipeline
summarizer = pipeline("summarization")
summarizer("The present invention discloses a pharmaceutical composition comprising therapeutically effective amount of, or an extract consisting essentially therapeutically effective amount of at least one cannabinoid selected from the group consisting of: Cannabidiol (CBD) or a derivative thereof, Tetrahydrocannabinol (THC) or a derivative thereof, and any combination thereof, for use in the treatment of multiple myeloma (MM). The present invention further discloses methods and uses of the aforementioned composition.",
min_length=5, max_length=10)
输出是
[{'summary_text': ' The present invention discloses a pharmaceutical'}]
这只是文本分析的开始。我做错了什么
您给出了一个参数max_length=10,这意味着生成文本的最大长度不应超过10个标记。通过增加这个数字,生成的摘要将变得更长
相关问题 更多 >
编程相关推荐