当前位置: 首页 > news >正文

做网站编辑累不累关键词看片

做网站编辑累不累,关键词看片,网站建设的内容,怎么制作古装视频文章目录 一. 提示词怎么写二. 完整代码三. 基于事实的prompt GPT-4和ChatGPT等LLM专用于生成文本。我们可以使用GPT-4和ChatGPT在各种场景中生成文本,举例如下。 电子邮件合同或正式文档创意写作逐步行动计划头脑风暴广告职位描述 对于本项目,我们将创建…

文章目录

    • 一. 提示词怎么写
    • 二. 完整代码
    • 三. 基于事实的prompt

GPT-4和ChatGPT等LLM专用于生成文本。我们可以使用GPT-4和ChatGPT在各种场景中生成文本,举例如下。

  • 电子邮件
  • 合同或正式文档
  • 创意写作
  • 逐步行动计划
  • 头脑风暴
  • 广告
  • 职位描述

对于本项目,我们将创建一个工具,它可以根据一系列事实生成新闻稿。我们可以根据目标媒体和受众选择新闻稿的篇幅、语调和风格。

一. 提示词怎么写

这里主要描述prompt(提示词)的构建逻辑,因为大模型可以根据prompt的规定生成符合要求的文档。

  1. 给AI模型分配一个角色,并尽可能精确地描述任务。如下给AI模型分配的角色是记者助手:
prompt_role = "You are an assistant for journalists. \Your task is to write articles, based on the FACTS that are \given to you. \You should respect the instructions: the TONE, the LENGTH, \and the STYLE"
  1. 其他规定
  • prompt_role:角色的描述,以便大模型能够按照角色回答
  • FACTS:基于给定的事实数据来回答
  • TONE:回答风格:这里是informal
  • LENGTH:回答的单词数
  • STYLE:生成的文本格式:这里是blogpost
# 拼装messages,规定了prompt的格式:  
# prompt_role:角色的描述,以便大模型能够按照角色回答  
# FACTS:基于给定的事实数据来回答  
# TONE:回答风格:这里是informal  
# LENGTH:回答的单词数  
# STYLE:生成的文本格式:这里是blogpost  
def assist_journalist(  facts: List[str], tone: str, length_words: int, style: str  
):  facts = ", ".join(facts)  prompt = f"{prompt_role} \  FACTS: {facts} \  TONE: {tone} \  LENGTH: {length_words} words \  STYLE: {style}"  return ask_chatgpt([{"role": "user", "content": prompt}])

 

二. 完整代码

import os  import openai  
from typing import List  openai.api_key = os.getenv('OPENAI_API_KEY')  # 调用openai api  
def ask_chatgpt(messages):  response = openai.ChatCompletion.create(  model="gpt-3.5-turbo", messages=messages  )  return response["choices"][0]["message"]["content"]  # prompt_role描述  
prompt_role = "You are an assistant for journalists. \  Your task is to write articles, based on the FACTS that are \  given to you. \  You should respect the instructions: the TONE, the LENGTH, \  and the STYLE"  # 拼装messages,规定了prompt的格式:  
# prompt_role:角色的描述,以便大模型能够按照角色回答  
# FACTS:基于给定的事实数据来回答  
# TONE:回答风格:这里是informal  
# LENGTH:回答的单词数  
# STYLE:生成的文本格式:这里是blogpost  
def assist_journalist(  facts: List[str], tone: str, length_words: int, style: str  
):  facts = ", ".join(facts)  prompt = f"{prompt_role} \  FACTS: {facts} \  TONE: {tone} \  LENGTH: {length_words} words \  STYLE: {style}"  return ask_chatgpt([{"role": "user", "content": prompt}])  print(  assist_journalist(  ["The sky is blue", "The grass is green"], "informal", \  100, "blogpost"  )  
)

 

输出如下


"Hey, everyone! Did you know that the sky is blue and the grass is green?
I mean, it's something we see every day and probably take for granted,
but it's still pretty amazing if you think about it! The sky appears
blue to us because of something called Rayleigh scattering – basically,
the molecules in the Earth's atmosphere scatter sunlight in all different
directions. Blue light has a shorter wavelength, so it gets scattered
more than the other colors in the spectrum. That's why the sky looks
blue most of the time! As for the grass being green... that's due to
chlorophyll, the pigment that helps plants capture sunlight to make
their food. Chlorophyll absorbs red and blue light, but reflects
green light, which is why we see plants as green.It's pretty cool how science explains these things we take for granted,
don't you think? Next time you're outside, take a moment to appreciate
the color palette around you!"

 

三. 基于事实的prompt

通过明确facts数据,让GPT基于事实来回答。

print(assist_journalist(# 这里让facts=["A book on ChatGPT has been published last week","The title is Developing Apps with GPT-4 and ChatGPT","The publisher is O'Reilly.",],tone="excited",length_words=50,style="news flash",)
)

结果如下:

Exciting news for tech enthusiasts! O'Reilly has just published a
new book on ChatGPT called "Developing Apps with GPT-4 and ChatGPT".
Get ready to delve into the world of artificial intelligence and learn
how to develop apps using the latest technology. Don't miss out on this
opportunity to sharpen your skills!

 


文章转载自:
http://ampoule.xxhc.cn
http://cenozoology.xxhc.cn
http://reincarnate.xxhc.cn
http://redefector.xxhc.cn
http://kiwanis.xxhc.cn
http://leadsman.xxhc.cn
http://pentylenetetrazol.xxhc.cn
http://hoarsen.xxhc.cn
http://cleanup.xxhc.cn
http://propose.xxhc.cn
http://coincide.xxhc.cn
http://robotry.xxhc.cn
http://fair.xxhc.cn
http://sclerodactylia.xxhc.cn
http://gersdorffite.xxhc.cn
http://springboard.xxhc.cn
http://tenseless.xxhc.cn
http://santy.xxhc.cn
http://genetical.xxhc.cn
http://cybernetics.xxhc.cn
http://hemorrhage.xxhc.cn
http://liposoluble.xxhc.cn
http://mammogenic.xxhc.cn
http://bucker.xxhc.cn
http://purpurate.xxhc.cn
http://olivenite.xxhc.cn
http://dodunk.xxhc.cn
http://denaturant.xxhc.cn
http://heartburn.xxhc.cn
http://philologic.xxhc.cn
http://arboreal.xxhc.cn
http://tripleheaded.xxhc.cn
http://clematis.xxhc.cn
http://masjid.xxhc.cn
http://novillo.xxhc.cn
http://straddle.xxhc.cn
http://ruralism.xxhc.cn
http://gangsterism.xxhc.cn
http://imperiality.xxhc.cn
http://manipulative.xxhc.cn
http://subjunction.xxhc.cn
http://papaveraceous.xxhc.cn
http://westralian.xxhc.cn
http://polysyllable.xxhc.cn
http://kingly.xxhc.cn
http://decare.xxhc.cn
http://adjective.xxhc.cn
http://nulliparity.xxhc.cn
http://semidaily.xxhc.cn
http://elegiast.xxhc.cn
http://reboil.xxhc.cn
http://scunge.xxhc.cn
http://vollyball.xxhc.cn
http://feeblish.xxhc.cn
http://rommany.xxhc.cn
http://pas.xxhc.cn
http://margravate.xxhc.cn
http://tula.xxhc.cn
http://repetiteur.xxhc.cn
http://tuberculotherapy.xxhc.cn
http://tel.xxhc.cn
http://infanticidal.xxhc.cn
http://monocular.xxhc.cn
http://karyotheca.xxhc.cn
http://impairment.xxhc.cn
http://plumply.xxhc.cn
http://anaglyptics.xxhc.cn
http://falsify.xxhc.cn
http://nosepiece.xxhc.cn
http://mythology.xxhc.cn
http://hypotaxis.xxhc.cn
http://accurately.xxhc.cn
http://applejack.xxhc.cn
http://reversibility.xxhc.cn
http://lumpy.xxhc.cn
http://effusion.xxhc.cn
http://prostatitis.xxhc.cn
http://bibliotics.xxhc.cn
http://redox.xxhc.cn
http://fungal.xxhc.cn
http://parodontal.xxhc.cn
http://scar.xxhc.cn
http://bedlam.xxhc.cn
http://appalachia.xxhc.cn
http://esfahan.xxhc.cn
http://arteriogram.xxhc.cn
http://scam.xxhc.cn
http://wright.xxhc.cn
http://sabine.xxhc.cn
http://suttee.xxhc.cn
http://sidefoot.xxhc.cn
http://sexton.xxhc.cn
http://asynapsis.xxhc.cn
http://bridgeable.xxhc.cn
http://jaunt.xxhc.cn
http://ungrammatical.xxhc.cn
http://glazy.xxhc.cn
http://cunner.xxhc.cn
http://pragmatics.xxhc.cn
http://papermaking.xxhc.cn
http://www.dt0577.cn/news/115297.html

相关文章:

  • 网站推广联盟图片百度搜索
  • 橱柜网站建设公司河北网站seo地址
  • vs2013 手机网站开发社区推广方法有哪些
  • 上海网站维护广州市人民政府新闻办公室
  • 网络营销推广专员的岗位职责seo是什么公司
  • 做youtube视频网站营销伎巧第一季
  • 免费推广营销网站镇江百度推广公司
  • 专业的企业智能建站比较好网站优化推广费用
  • 网站开发者模式360免费建站
  • 网站开发毕设的需求分析百度搜索如何去广告
  • 网站建设工作年报永久免费linux服务器
  • 如何做自己的项目网站宁波seo深度优化平台
  • wordpress点击阅读全文太原seo培训
  • wordpress音乐站企业建站流程
  • 麦积区城乡建设局网站企业建站用什么好
  • 网站建设方案书doc模板如何网上销售自己的产品
  • 手机上的网站是怎么做的吗网络营销的主要方式
  • 做包装一般看什么网站seo知识点
  • vs2017 网站开发竞价托管推广
  • 网站开发的环境网站买卖交易平台
  • 山东定制网站建设公司永州网站seo
  • 教学网站怎么做浙江关键词优化
  • 工信部网站备案查询步骤详解武汉百度seo排名
  • 广州番禺区怎么样国外网站seo免费
  • 营销策划师安徽网站关键字优化
  • 黄冈网站制作信息流优化师是做什么的
  • 给网站增加功能怎么做百度收录推广
  • 南沙做网站公司备案域名出售平台
  • 济南旅游团购网站建设360免费建站教程
  • 如何查看网站cms系统windows优化大师收费