用于获取给定提示的 3 句话摘要的选项
您可以通过多种方式告诉 OpenAI API 您需要 3 句摘要:
- 选项1:
Write TL;DR in 3 sentences
(7 个代币)
- 选项2:
TL;DR 3 sentences
(5 个代币)
- 选项 3:
Write summary in 3 sentences
(5 个代币)
- 选项 4:
Summary 3 sentences
(3 个代币)
注意:我用的是分词器 https://beta.openai.com/tokenizer来计算令牌的数量。
以上所有内容都将返回 3 句话摘要。
选择选项 4
为什么?因为您需要为您使用的每个代币付费。因此,选项 4 的成本最低。
更重要的是?如果你写TL;DR
你会烧掉 3 个代币,即the same就像你写的一样Summary 3 sentences
。换句话说,你的花费是一样的,但是如果你写的话你会得到一个 3 句话的总结Summary 3 sentences
.
另外,不要忘记设置max_tokens
参数足够高,因此 OpenAI API 可以返回 3 个句子。
一个例子
我们举个官方的例子开放人工智能网站 https://beta.openai.com/examples/default-tldr-summary.
Prompt:
A neutron star is the collapsed core of a massive supergiant star, which
had a total mass of between 10 and 25 solar masses, possibly more if the
star was especially metal-rich.[1] Neutron stars are the smallest and
densest stellar objects, excluding black holes and hypothetical white
holes, quark stars, and strange stars.[2] Neutron stars have a radius on
the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses.
[3] They result from the supernova explosion of a massive star, combined
with gravitational collapse, that compresses the core past white dwarf star
density to that of atomic nuclei.
Summary 3 sentences
完成:
中子星是最小、密度最大的恒星天体,具有
半径约10公里,质量为1.4个太阳质量。他们是
由一颗大质量恒星的超新星爆炸形成,该恒星具有
总质量在 10-25 个太阳质量之间,加上引力
塌陷将核心压缩到超出白矮星密度。像这样,
中子星代表了大质量超巨星的塌缩核心
星星。