吴恩达chatgpt学习

1、技术文档常用英文词汇

1、 harmonized documentation:【协调一致的文档】指的是确保文档在整个集团或公司内保持统一的标准和风格。
2、 operating instructions:【操作指南】是指导用户如何正确使用产品或设备的手册或指南。
3、 assembly instructions:【装配说明】是指引导用户如何组装产品或设备的详细步骤。
4、 content management system(CMS):【内容管理系统】是一种软件,用于创建、管理和修改数字内容,通常用于管理网站内容或文档。
5、 publications:【出版物】指的是供公众阅读的各种印刷品或数字格式的资料,如书籍、杂志、报告等。
6、 layout control:【布局控制】指的是对文档或出版物的视觉布局(如文字排版、图片位置等)进行管理和调整。
7、 customer documentation:【客户文档】是指专门为客户提供的文档,包括使用说明、技术规格等信息。
8、 3D drawing:【3D图纸】是指三维绘图,用于详细展示产品或部件的结构。
9、 Graphic Data:【图形数据】指的是用于制作图表、插图或其他视觉内容的数据。
10、 Time scheduling:【时间规划】是指安排和管理工作或项目的时间表。
11、 Coordination:【协调】是指与其他部门、客户、供应商或集团公司等不同方进行沟通与合作,以确保工作流程的顺畅。
12、 Standards-Based:【基于标准的】意味着工作需要遵循一定的行业或组织标准。
13、 Uniform Terminology:【统一术语】,指的是工作中使用一致的专业术语,以避免混淆和误解。
14、 Editorial Guidelines:【编辑指南】,这是一组规定,指导如何撰写和编辑文档,包括文档的风格、格式和语言等方面的要求。
15、 Content management:【内容管理】,涉及创建、编辑、发布和存档数字内容的过程。
16、 Archiving of order documentation:【订单文档的存档】,指的是保管与订单相关的所有文档和记录的过程。
17、 University of applied sciences:【应用科学大学】一种以应用技术和实践技能为重点的高等教育机构。
18、 Technical documentation:【技术文档】指解释和描述产品或服务的技术方面的文档。
19、 Technical communication:【技术交流】指使用书面和视觉形式沟通技术信息的能力。
20、 Linguistics:【语言学】研究人类语言的科学
21、 Engineering degree:【工程学位】指的是在工程学领域获得的学术学位。
22、 Comparable additional training:类似的额外培训,指的是除了正式学位以外,在相关领域获得的额外教育或培训。

2、指南

策略1 编写明确和具体的指令

1.1 使用分割符号如:

”””
```
- - -
< >
</tag/></tag/>

import openai  ##导入openai模块
openai.api_key=”sk-”
model=”gpt-3.5-turbo” ##指定gpt模型版本
def get_completion(prompt,model=”gpt-3.5-turbo”):
  messages=[{“role”:”user”,”content”:prompt}]
 ## 创建一个名为`messages`的列表,其中包含一个字典,该字典表示用户的输入,其中
  `role`键的值为”user”,’’content’’键的值为传入函数‘prompt’参数。
  response=openai.ChatCompletion.create(
     model=model,
     messages=messages,
     temperature=0
)
## 调用openai的``ChatCompletion.create`方法,传入模型名称、消息列表和温度参数
(temperature=0)。这个方法将根据提供的提示生成响应,温度参数控制响应的随机性,
值为0意味着生成确定性的输出,即总是生成相同的响应。

return response.choices[0].message[“content”] ##从API的响应中提取并返回AI生成的文本内容。
text=f”””
You should express what you want a model to do by\
providing instructions that are as clear and\
specific as you can possibly make them.\
This will guide the model towards the desired output,\
or incorrect response.Don’t confuse writing a\
clear prompt with writing a short prompt.\
In many cases,longer prompts provide more clarity\
and context for the model,which can lead to \
more detailed and relevant outputs.
”’”
Prompt=f''''''
Summarize the text delimited by triple backticks\
into a single sentence.
##将被三个反引号界定的文本总结为一句话。
```text ```
''''''
response=get_completion(prompt)
print(response)

可以用来总结联影现在的产品

1.2 结构化输出

Html\json

prompt=f’’’’’’
generate a list of three made-up book titles along\with their authors\
 and genres.
      Provide them in JSON format with the following keys:
       book_id,title,author,genre.
      ’’’’’’
response=get_completion(prompt)
print(response)

1.3 检查

要求模型检查是否满足条件,如果任务存在假设未必满足,可以告诉模型首先检查这些假设,如果不满足,则指示并停止尝试完全完成任务,考虑潜在的边缘情况,以及模型如何处理他们,以避免意外错误或结果。

text_1=f’’’’’’
making a cup of tea is easy!first,you need to get some\
water boling .while that’s happening,\
grab a cup and put a tea bag in it,once the water is \
hot enough,just pour it over the tea bag,\
let it sit for a bit so the tea can steap.after a \
few minutes,take out the tea bag,if you \
like,you can add some sugar or milk to taste.\
and that’s it!you’ve got yourself a delicious\
cup of tea to enjoy.
’’’’’’
Prompt=f’’’’’’
You will be provided with text delimited by triple quotes,if it contains a\ sequence of instructions,\
Re-write those instructions in the following formate:\
Step 1-…
Step 2-…
-
Step N-…
If the text does not contain a sequence of instructions,\
then simply write \’’No steps provides\’’  ##如果文本不包含指令序列,就输出
\’’\’’\’’{text_1}\’’\’’\’’
’’’’’’
response=get_completion(prompt)
print(“Completion for Text 1:”)
print(response)

1.4 少量训练提示few-shot prompting

(要求模型执行任务之前,提供成功执行任务的示例)

Prompt=f’’’’’’
Your task is to answer in a consistent style. ##你的任务是以一致的风格回答
<child>:Teach me about patience.##<孩子>:教我关于耐心
<grandparent>:the river that carves the deepest\##<祖父>刻画最深河谷的河流起源于一个温和的泉水;最宏伟的交响乐起源于一个简单的音符;最复杂的挂毯起源于一根孤单的线。
Valley flows from a modest spring;the\
grandest symphony originates from a single note;\
the most intricate tapestry begins with a  solitary thread.
<child>:Teach me about resilience.##<孩子>:教我关于适应力
’’’’’’
Response=get_completion(prompt)
print(response)

策略2 给模型思考的时间

如果模型急于做出错误的结论会出现推理错误,在模型给出错误的答案之前,应当重新构建查询请求相关推理的链或序列

2.1 指定完成任务所需的步骤(specify the steps to complete a task)

Step1:…
Step2:…

StepN:…
Text=f’’’’’’
In a charming village,siblings Jack and Jill set out on\  ##在一个迷人的村庄里,兄妹杰克和吉尔开始了一次任务
a quest to fech water from a hilltop\  ##去山顶上的井里打水
well.As they climbed,singing joyfully,misfortune\ ##他们欢快地唱着歌攀爬时
stuck-Jack tripped on a stone and tumbled\ ##不幸降临了——杰克被一块石头绊倒了,滚下了山坡
down the hill,.with Jill following suit.\ ##吉尔也紧随其后
Though slightly battered,the pair returned home to\ ##尽管有些受伤,这对兄妹还是回到了家里
Comforting embraces.Despite the mishap,\ ##得到了安慰地拥抱
Their adventurous spirits remained undimmed,and they\ ##尽管发生了这个小意外,他们那冒险的精神依然未减
continued exploring with delight. ##继续快乐地探索着
prompt_1=f’’’’’’
perform the following actions:
1-	summarize the following text delimited by triple\
backticks with 1 sentence. ## 使用一句话总结由三个反引号分隔的以下文本
2-	translate the summary into French.##将摘要翻译成法文
3-	List each name in the French summary. ##列出法文摘要中的每个名字
4-	Output a json object that contains the following \ ##输出一个包含以下键的json 对象:法文摘要,名字数量
keys:french_summary,num_names
separate your answers with line breaks. ##用换行符分隔答案
Text:
```{text}```
’’’’’’
response=get_completion(prompt_1)
print(“Completion for prompt 1:”)
print(response)

prompt_2=f’’’’’’
your task is to perform the following actions:
1-	Summarize the following text delimited by triple quotes with 1 sentence.
2-	Translate the summary into French
3-	List each name in the frech summary.
4-	Output a json object that contains the following keys:French_summary,num_name.

     Use the following format:
     Text :<text to summarize>
     Summary :<summary>
     Translation:<summary translation>
     Names:<list of names in Italian summary>
     Output JSON:<Json with summary and num_names >
     Text to summarize:<{text}>
     ’’’’’’
     response=get_completion(prompt_2)
     print(“\nCompletion for prompt 2 :”)
     print(response)

2.2 指示模型在匆忙做出结论之前思考解决方案

prompt=f’’’’’’
determine if the student’s solution is correct or not. 判断学生的解答是否正确。
Question: 问题:
I’m building a solar power installation and I need\我正在建设一个太阳能发电装置, 
help working out the financials. 我需要帮助计算财务成本。
-	Land costs $100 /square foot土地成本为每平方英尺100美元
-	I can buy solar panels for $250/square foot我可以以每平方英尺250美元的价格购买太阳能板
-	I negotiated a contract for maintenance that will cost\
me a flat $100k per year,and an additional$10/square\
foot  我谈判了一份维护合同,每年固定成本为10万美元,另外每平方英尺增加10美元 
   what is the total cost for the first year of operations as a function of the number of square feet. 第一年运营的总成本是多少,作为平方英尺数量的函数。

   Student’s solution:
  Let x be the size of the installation in square feet. 设 x 为装置的面积,单位为平方英尺。
  Costs:
1.	Land cost:100x土地成本:100x
2.	Solar panel cost:250x太阳能板成本:250x
3.	Maintenance cost:100000+100x维护成本:100000 + 10x
Total cost :100x+250x+100000+100x=450x+100000总成本:100x + 250x + 100000 + 10x = 450x + 100000
’’’’’’
response=get_completion(prompt)
print(response)

改进后的:

prompt
 prompt=f’’’’’’
your task is to determine if the student’s solution\
is correct or not.
To solve the problem do the following:\
-first ,work out your own solution to the problem.
-then compare your solution to the student’s solution\
and evaluate if the student’s solution is correct or not.
Don’t decide if the student’s solution is correct until you have done the\
problem yourself.
Use the following format:
question:

Question here

Student’s solution:

Student’s solution here

Actual solution:
Steps to work out the solution and your solution here
Is the student’s solution the same as actual solution\
just calculated:

yes or no

student grade:

correct or incorrect 

Question:

 I’m building a solar power installation and I need\我正在建设一个太阳能发电装置, 
help working out the financials. 我需要帮助计算财务成本。
-	Land costs $100 /square foot土地成本为每平方英尺100美元
-	I can buy solar panels for $250/square foot我可以以每平方英尺250美元的价格购买太阳能板
-	I negotiated a contract for maintenance that will cost\
me a flat $100k per year,and an additional$10/square\
foot  我谈判了一份维护合同,每年固定成本为10万美元,另外每平方英尺增加10美元 
   what is the total cost for the first year of operations as a function of the number of square feet. 第一年运营的总成本是多少,作为平方英尺数量的函数。

   Student’s solution:
  Let x be the size of the installation in square feet. 设 x 为装置的面积,单位为平方英尺。
  Costs:
1.	Land cost:100x土地成本:100x
2.	Solar panel cost:250x太阳能板成本:250x
3.	Maintenance cost:100000+100x维护成本:100000 + 10x
Total cost :100x+250x+100000+100x=450x+100000总成本:100x + 250x + 100000 + 10x = 450x + 100000
’’’’’’
response=get_completion(prompt)
print(response)


策略3 大模型幻觉

在使用大型语言模型开发应用程序时,即便模型在其训练过程中暴露大量知识,但模型并不会完全记住所看到的信息,因此它并不能完全了解知识的边界,当大型语言模型在尝试回答晦涩主题的问题时,会编造听起来很合理但实际上不正确的内容,这些虚幻的想法称为幻觉。
Hallucination:Makes statements that sound plausible but are not true
基于文本生成答案的情况下减少模型出现幻觉的策略reducing hallucinations:
1、 Find relevant information要求模型首先从文本中找到任何相关的引用
2、 Answer the question based on the relevant information然后要求它使用这些引用来回答问题
3、 并且可以追溯答案回源文档通常可以帮助减少这些幻觉

3、迭代

Iterative prompt development
想法→编写代码→获取数据→训练模型→得到实验结果→运行另一个实验→循环迭代→获得有效的机器学习模型
Prompt guidelines

  • Be clear and specific
  • Analyze why result does not give desired output
  • Refine the idea and the prompt
  • Repeat
    举例:
 Import openai 
   Import os
   from dotenv import load_dotenv,find_dotenv_=load_dotenv(find_dotenv())
   openai.api_key=os.getenv(‘OPENI_API_KEY’)
   
def get_completion(prompt,model=”gpt-3.5-turbo”):
  messages=[{“role”:”user”,”content”:prompt}]##创建一个名为`messages`的列表,其中包含一个字典,该字典表示用户的输入,其中`role`键的值为”user”,’’content’’键的值为传入函数‘prompt’参数。
  response=openai.ChatCompletion.create(
     model=model,
     messages=messages,
     temperature=0
)##调用openai的``ChatCompletion.create`方法,传入模型名称、消息列表和温度参数(temperature=0)。这个方法将根据提供的提示生成响应,温度参数控制响应的随机性,值为0意味着生成确定性的输出,即总是生成相同的响应。
return response.choices[0].message[“content”] ##从API的响应中提取并返回AI生成的文本内容。

Fact_sheet_chair=’’’’’’
OVERVIEW
-part of a beautiful family of mid-century inspired 

chatgpt可以做什么

  1. 资料搜索与整理:ChatGPT可以帮助您快速搜索和整理相关的技术、标准、法规信息,这对于编写符合行业规范的文档至关重要。
  2. 文档撰写与编辑:在撰写技术文档时,ChatGPT可以协助您进行文案撰写、编辑和校对,确保文档的准确性和专业性。
  3. 术语解释与翻译:对于专业术语或行业特定语言,ChatGPT可以提供解释和翻译,帮助您更好地理解和使用这些术语。
  4. 格式与结构优化:ChatGPT可以建议文档的格式和结构优化方案,使文档更加清晰、易读。
  5. 自动化脚本和工具推荐:根据您的需求,ChatGPT可以推荐一些自动化脚本或工具,以提高您编写和管理技术文档的效率。
  6. 行业动态更新:ChatGPT可以提供医疗器械行业的最新动态和趋势分析,帮助您保持信息的时效性。
  7. 问题解答与建议:面对工作中遇到的具体问题,ChatGPT可以提供解答和建议,帮助您找到解决问题的方法。
  8. 学习与培训资源:提供相关的学习材料和培训资源,帮助您不断提升专业技能和行业知识。

ChatGPT可以通过多种方式帮助提高技术文档工程师的工作效率。以下是一些具体应用场景以及如何利用和训练ChatGPT以适应这些需求:

  1. 自动化常规查询处理:ChatGPT可以被训练来回答常见的技术问题或解释复杂的技术术语。这可以减少工程师在处理重复性问题上的时间花费。
    训练方法:通过向ChatGPT提供行业特定的术语、FAQs和典型案例,增强其在特定领域的回答能力。
  2. 草拟和编辑文档:ChatGPT可以帮助快速草拟初步的文档框架或编辑已有文档,提高文档编写的效率。
    训练方法:向ChatGPT提供样本文档,展示所需的文档风格、格式和结构。
  3. 提供编写建议和校对服务:ChatGPT可以提供写作建议,帮助改善文档的清晰度和专业性,同时也可以辅助校对文档,寻找和纠正错误。
    训练方法:输入具有典型错误的文档片段,让ChatGPT进行修正,逐渐提升其校对能力。
  4. 知识库查询:ChatGPT可以快速从大量技术资料中检索信息,帮助工程师找到所需的参考资料或数据。
    训练方法:定期更新和输入最新的行业资料和数据,让ChatGPT了解当前的行业趋势和标准。
  5. 流程优化建议:利用ChatGPT分析现有的文档管理和制作流程,提出优化建议。
    训练方法:让ChatGPT分析现有流程的案例,提出改进方案。
  6. 跨语言支持:对于跨国公司或需要处理多语言文档的情况,ChatGPT可以提供翻译和语言支持。
    训练方法:输入多语言文档,训练ChatGPT进行有效的翻译和语言转换。
  • 21
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值