首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gpt 3关键词萃取器

Gpt 3关键词萃取器
EN

Stack Overflow用户
提问于 2022-06-03 04:05:52
回答 1查看 807关注 0票数 1

我已经习惯了gpt,我想为书摘要构建一个关键词提取器。有人能给我指点那些对我用例有帮助的参考资料吗?

EN

回答 1

Stack Overflow用户

发布于 2022-06-22 09:58:47

要从文本中提取关键字,可以使用OpenAI GPT-3模型的关键字提取示例。

代码语言:javascript
复制
import os
import openai

openai.api_key = os.getenv("OPENAI_API_KEY")

response = openai.Completion.create(
  model="text-davinci-002",
  prompt="Extract keywords from this text:\n\nBlack-on-black ware is a 20th- and 21st-century pottery tradition developed by the Puebloan Native American ceramic artists in Northern New Mexico. Traditional reduction-fired blackware has been made for centuries by pueblo artists. Black-on-black ware of the past century is produced with a smooth surface, with the designs applied through selective burnishing or the application of refractory slip. Another style involves carving or incising designs and selectively polishing the raised areas. For generations several families from Kha'po Owingeh and P'ohwhóge Owingeh pueblos have been making black-on-black ware with the techniques passed down from matriarch potters. Artists from other pueblos have also produced black-on-black ware. Several contemporary artists have created works honoring the pottery of their ancestors.",
  temperature=0.3,
  max_tokens=60,
  top_p=1.0,
  frequency_penalty=0.8,
  presence_penalty=0.0
)

一些参考资料:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72484590

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档