如何让GPT3以JSON格式输出

This past Friday I attended an AI Hackathon in Amsterdam where me and my team built an application that scans difficult letters from the government and helps simplify them for low-literate people (it won a prize by the way :)). You can check out the video pitch in this tweet.

上周五,我参加了在阿姆斯特丹举行的人工智能黑客马拉松,我和我的团队建立了一个应用程序,扫描来自政府的困难信件,并帮助低文化水平的人简化它们(顺便说一下,它赢得了一个奖项:)。你可以在这条推文中查看视频推介。

The app we made interfaced with the OpenAI API to send our scanned letter with our engineered prompt to in turn receive the output generated by the text-DaVinci-03 model. Our prompt was engineered in such a way that the text the model outputted was in JSON format and could be easily parsed. This allowed us to easily put the data in the right places in the application.

我们制作的应用程序与OpenAI的API接口,发送我们的扫描信和我们设计的提示,反过来接收text-DaVinci-03模型产生的输出。我们的提示是以这样一种方式设计的,即模型输出的文本是JSON格式,可以轻松解析。这使我们能够轻松地将数据放在应用程序中的正确位置。

In this post, I will give some tips and findings from building this application and how you can prompt a GPT3 model such as text-DaVinci-03 to return a JSON formatted text. We got prompt engineering help from Jordi Bruin, so make sure to check out his projects on Twitter.

在这篇文章中,我将给出一些建立这个应用的技巧和发现,以及如何提示一个GPT3模型,如text-DaVinci-03来返回一个JSON格式的文本。我们得到了Jordi Bruin的及时工程帮助,所以一定要在Twitter上查看他的项目。

What are a GPT3 and a JSON?

什么是GPT3和JSON?

GPT3 is a powerful language model that can generate text from a given prompt. It is capable of understanding natural language and can generate text that is coherent and relevant to the given prompt. GPT3 can be used to generate text for a variety of applications, such as summarizing conversations, generating stories, and generating code.

GPT3是一个强大的语言模型,可以从给定的提示生成文本。它能够理解自然语言,并能生成与给定提示相一致和相关的文本。GPT3可用于生成各种应用的文本,如总结对话、生成故事和生成代码。

JSON (JavaScript Object Notation) is a lightweight data interchange format. It is a text-based format that is used to store and exchange data. JSON is easy to read and write and is often used to exchange data between a server and a web application.

JSON(JavaScript Object Notation)是一种轻量级的数据交换格式。它是一种基...

开通本站会员,查看完整译文。

trang chủ - Wiki
Copyright © 2011-2024 iteam. Current version is 2.137.3. UTC+08:00, 2024-11-28 18:38
浙ICP备14020137号-1 $bản đồ khách truy cập$