全网最详细中英文ChatGPT-GPT-4示例文档-从0到1快速入门解析非结构化数据应用——官网推荐的48种最佳应用场景(附python/node.js/curl命令源代码,小白也能学)

ChatGPT是目前最先进的AI聊天机器人,它能够理解图片和文字,生成流畅和有趣的回答。如果你想跟上AI时代的潮流,你一定要学会使用ChatGPT。如果你想了解OpenAI最新发布的GPT-4模型,以及它如何为ChatGPT聊天机器人带来更强大的功能,那么你一定不要错过OpenAI官网推荐的48种最佳应用场景,不管你是资深开发者、初学者,你都能够从0到1快速入门,并掌握他们。
在这个AI大时代,如果不想被人颠覆,就要先颠覆别人。如果你颠覆不了别人,那你就努力运用ChatGPT提高你的技术水平和创造力。
ChatGPT可以利用自然语言理解和生成的能力,来处理非结构化数据。非结构化数据是指没有预定义的数据模型,不方便用数据库二维逻辑表来存储和查询的数据。ChatGPT可以将非结构化数据解析成结构化数据,例如表格、图表、列表等,从而方便用户进行分析和决策。例如,ChatGPT可以从一篇文章中提取出关键信息,并生成一个摘要表格;或者可以从一张图片中识别出物体,并生成一个标签列表。
Introduce 简介
Parse unstructured data 解析非结构化数据
Create tables from long form text by specifying a structure and supplying some examples.
通过指定结构并提供一些示例,从长格式文本创建表格。
setting 设置
Engine: text-davinci-003
Max tokens:100
Temperature:0
Top p:1.0
Frequency penalty:0.0
Presence penalty:0.0
说明:
0、Engine设置定义了你要使用的模型,例如 text-davinci-003 是一个文本生成模型。这种模型可以根据输入的文本,生成新的、相关的文本。
1、Max tokens是指在请求中最多允许返回的 token 数目,比如你可以指定 chatGPT 返回最多 100个 token。这可以帮助你控制输出的内容大小,以便更好地控制响应速度和结果。一般1个token约4个字符或者0.75个单词
2、Temperature是一个参数,用于控制 chatGPT 的输出。它决定了 chatGPT 在生成文本时会多么“随意”。值越高,chatGPT 生成的文本就越不可预测;值越低,chatGPT 生成的文本就越可预测。它在0.0到2.0之间,Temperature设置为0意味着ChatGPT将会生成更加保守的回复,即更少的随机性和更多的准确性,这可以帮助你在聊天中更好地控制语义,并且可以防止ChatGPT产生不相关的内容。通常建议更改此值或Top P,但不要同时更改这两个值。
3、Top p是随温度采样的替代方案,称为核采样,其中模型考虑具有top_p概率质量的标记的结果。因此0.1意味着仅考虑包括前10%概率质量的记号。通常建议更改此值或temperature,但不要同时更改这两个值。
4、Frequency penalty是指在训练时,模型会根据词频来调整每个单词的重要性。它可以帮助模型更好地理解文本,并减少过拟合。介于-2.0和2.0之间的数字。正值会根据新标记在文本中的现有频率惩罚新标记,从而降低模型逐字重复同一行的可能性。Frequency penalty设置为0意味着模型不会对重复的词进行惩罚。它可以帮助模型生成更多的新词,而不是重复使用已有的词。
5、Presence penalty是指在ChatGPT中,一些预先定义的条件或者状态可能会影响机器人回答的质量,介于-2.0和2.0之间的数字。正值会根据新标记到目前为止是否出现在文本中来惩罚它们,从而增加模型谈论新主题的可能性。如果将 Presence penalty 设置为 0,则表示不会有任何惩罚。
Prompt 提示
A table summarizing the fruits from Goocrux: Goocrux的水果表格
There are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy. There are also loheckles, which are a grayish blue fruit and are very tart, a little bit like a lemon. Pounits are a bright green color and are more savory than sweet. There are also plenty of loopnovas which are a neon pink flavor and taste like cotton candy. Finally, there are fruits called glowls, which have a very sour and bitter taste which is acidic and caustic, and a pale orange tinge to them.
| Fruit | Color | Flavor |
在最近发现的Goocrux行星上发现了许多水果。那里生长着neoskizzles,紫色的,吃起来像糖果。还有loheckles,这是一种灰蓝色的水果,非常酸,有点像柠檬。pounits是一个明亮的绿色,是更多的咸味比甜。也有大量的loopnovas,这是一个氖粉红色的味道,尝起来像棉花糖。最后,还有一种水果叫glowls,它有一种非常酸和苦的味道,是酸性和腐蚀性的,并有一种淡橙色调。
| 水果|颜色|风味|
Sample response 回复样本
| Neoskizzles | Purple | Candy |
| Loheckles | Grayish Blue | Tart, like a lemon |
| Pounits | Bright Green | Savory |
| Loopnovas | Neon Pink | Cotton Candy |
| Glowls | Pale Orange | Sour and Bitter, Acidic and Caustic |
API request 接口请求
python接口请求示例
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-003",
prompt="A table summarizing the fruits from Goocrux:\n\nThere are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy. There are also loheckles, which are a grayish blue fruit and are very tart, a little bit like a lemon. Pounits are a bright green color and are more savory than sweet. There are also plenty of loopnovas which are a neon pink flavor and taste like cotton candy. Finally, there are fruits called glowls, which have a very sour and bitter taste which is acidic and caustic, and a pale orange tinge to them.\n\n| Fruit | Color | Flavor |",
temperature=0,
max_tokens=100,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0
)
node.js接口请求示例
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: "A table summarizing the fruits from Goocrux:\n\nThere are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy. There are also loheckles, which are a grayish blue fruit and are very tart, a little bit like a lemon. Pounits are a bright green color and are more savory than sweet. There are also plenty of loopnovas which are a neon pink flavor and taste like cotton candy. Finally, there are fruits called glowls, which have a very sour and bitter taste which is acidic and caustic, and a pale orange tinge to them.\n\n| Fruit | Color | Flavor |",
temperature: 0,
max_tokens: 100,
top_p: 1.0,
frequency_penalty: 0.0,
presence_penalty: 0.0,
});
curl命令示例
curl https://api.openai.com/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "text-davinci-003",
"prompt": "A table summarizing the fruits from Goocrux:\n\nThere are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy. There are also loheckles, which are a grayish blue fruit and are very tart, a little bit like a lemon. Pounits are a bright green color and are more savory than sweet. There are also plenty of loopnovas which are a neon pink flavor and taste like cotton candy. Finally, there are fruits called glowls, which have a very sour and bitter taste which is acidic and caustic, and a pale orange tinge to them.\n\n| Fruit | Color | Flavor |",
"temperature": 0,
"max_tokens": 100,
"top_p": 1.0,
"frequency_penalty": 0.0,
"presence_penalty": 0.0
}'
json格式示例
{
"model": "text-davinci-003",
"prompt": "A table summarizing the fruits from Goocrux:\n\nThere are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy. There are also loheckles, which are a grayish blue fruit and are very tart, a little bit like a lemon. Pounits are a bright green color and are more savory than sweet. There are also plenty of loopnovas which are a neon pink flavor and taste like cotton candy. Finally, there are fruits called glowls, which have a very sour and bitter taste which is acidic and caustic, and a pale orange tinge to them.\n\n| Fruit | Color | Flavor |",
"temperature": 0,
"max_tokens": 100,
"top_p": 1.0,
"frequency_penalty": 0.0,
"presence_penalty": 0.0
}
其它资料下载
如果大家想继续了解人工智能相关学习路线和知识体系,欢迎大家翻阅我的另外一篇博客《重磅 | 完备的人工智能AI 学习——基础知识学习路线,所有资料免关注免套路直接网盘下载》
这篇博客参考了Github知名开源平台,AI技术平台以及相关领域专家:Datawhale,ApacheCN,AI有道和黄海广博士等约有近100G相关资料,希望能帮助到所有小伙伴们。
全网最详细中英文ChatGPT-GPT-4示例文档-从0到1快速入门解析非结构化数据应用——官网推荐的48种最佳应用场景(附python/node.js/curl命令源代码,小白也能学)的更多相关文章
- Python爬虫(九)_非结构化数据与结构化数据
爬虫的一个重要步骤就是页面解析与数据提取.更多内容请参考:Python学习指南 页面解析与数据提取 实际上爬虫一共就四个主要步骤: 定(要知道你准备在哪个范围或者网站去搜索) 爬(将所有的网站的内容全 ...
- PHP, Python, Node.js 哪个比较适合写爬虫?
PHP, Python, Node.js 哪个比较适合写爬虫? 1.对页面的解析能力2.对数据库的操作能力(mysql)3.爬取效率4.代码量推荐语言时说明所需类库或者框架,谢谢.比如:python+ ...
- 全网最详细的IDEA里如何正确新建普通的Java web项目并发布到Tomcat上运行成功【博主强烈推荐】(类似eclipse里同一个workspace下【一个子项目】并存)(图文详解)
不多说,直接上干货! 首先,大家要明确,IDEA.Eclipse和MyEclipse等编辑器之间的新建和运行手法是不一样的. 如果是在Myeclipse里,则是File -> new -> ...
- 全网最详细的Eclipse里如何正确新建普通的Java web项目并发布到Tomcat上运行成功【博主强烈推荐】(图文详解)
不多说,直接上干货! 首先,大家要明确,IDEA.Eclipse和MyEclipse等编辑器之间的新建和运行手法是不一样的. 如果是在Myeclipse里,则是File -> new -> ...
- 全网最详细的MyEclipse里如何正确新建普通的Java web项目并发布到Tomcat上运行成功【博主强烈推荐】(图文详解)
不多说,直接上干货! 首先,大家要明确,IDEA.Eclipse和MyEclipse等编辑器之间的新建和运行手法是不一样的. 如果是在eclipse里,则是File -> new -> ...
- 零基础学Python之结构化数据(附详细的代码解释和执行结果截图)
3结构化数据 字典(查找表).集合.元组.列表 3.1字典 是有两列任意多行的表,第一列存储一个键,第二列存储一个值. 它存储键/值对,每个唯一的键有一个唯一与之关联的值.(类似于映射.表) 它不会维 ...
- [Python]ctypes+struct实现类c的结构化数据串行处理
1. 用C/C++实现的结构化数据处理 在涉及到比较底层的通信协议开发过程中, 往往需要开发语言能够有效的表达和处理所定义的通信协议的数据结构. 在这方面是C/C++语言是具有天然优势的: 通过str ...
- Sublime Text3 配置Node.js运行命令
在Sublime Text中可以很容易配置新的编译运行命令,下面的截图是汉化版的中文菜单,英文菜单请直接对照. 首先需要在本地安装Node,默认的Node会加入到系统的环境变量,这样执行Node命 ...
- nodejs学习笔记Node.js 调试命令
3.4 调试 47 下面是一个简单的例子: $ node debug debug.js < debugger listening on port 5858 connecting ...
- node.js ffmpeg-concat 命令行形式处理多个视频的过度效果
ffmpeg-concat 是利用 gl-transitions 处理多个视频的过度效果.详细说明参见 https://github.com/transitive-bullshit/ffmpeg-co ...
随机推荐
- 1.3 C语言--指针与结构体
指针 指针概念的引入 关于内存 程序有数据和指令组成,数据和指令在执行过程中存放在内存中.变量是程序数据中的一种,因此变量也存储在内存中:内存中的每个字节都有一个唯一的编码,即内存地址.32位机的内存 ...
- C++入门之unordered_map
1.介绍 unordered_map是c++语言STL库中一个比较重要的容器,不能自动排序,这一容器是根据哈希表这一数据结构设计而成的,能够极大地提升数据搜索.插入和删除操作的时间效率. 2.头文 ...
- 2022-07-11 第一小组 张明旭 前端JS学习记录
今天是正式学习的第三天,每天一大部分前端的新知识,吐瘦两斤,听课晕乎乎的.不过小事,靠笔记和视频苟活 知识点: JavaScript是什么? 编程语言.脚本语言.依赖于某种容器(浏览器)运行 有浏览器 ...
- mysql之数据类型-第三篇
mysql数据库中的每个列都应该有适当的数据类型,用于限制或允许该列中存储的数据.mysql的数据类型分别有整数,浮点数和定点数类型,日期和时间类型,字符串类型和二进制类型等. 整数类型 数值型数据类 ...
- 【flask】建站经验随笔
[前端] 1.前端table标签中每行使用template中 {%for i in rows%} {% endfor %}来生成之后,如果想对每行进行一个button处理,此时如果使用jquery的$ ...
- Python中RSA的PKCS#1、PKCS#8,MD5加密
一.Python-RSA RSA库只支持PKCS#1的密钥格式 需要安装第三方库rsa pip install rsa python-rsa官方地址:https://stuvel.eu/python- ...
- 学Java的第5天,今天做了个双色球系统
今天是学JAVA的第5天,刚刚把方法学完,然后就在这做黑马的题. 用了一个多小时时间,把他的 这些题都做完了 但是最后一道题,这个双色球系统我感觉挺有意思的 我看到这个题,分析后感觉需要4种方法: 1 ...
- python:包含’e’和‘-’的 str 转 float
from functools import reduce def str2float(s): s = s.split('.') a = s[0] b = s[1] if a[0] == '-': a ...
- npm安装时加 --save和不加的区别
npm install xxx --save 命令是安装模块到项目node_modules目录下,会将模块依赖写入package.json文件中的dependencies{}下.如果将node_mod ...
- 过滤器函数 filtes 的使用总结
// import parseTime, formatTime and set to filter /** * Show plural label if time is plural number * ...