来到 微软为它架了一座桥 user interface 新一代的交互方式LUI language

  • 电脑网络维修
  • 2024-11-14

ChatGPT为代表的LLM以其冷艳的人造言语了解才干获取群众认可之后,一大量基于人造言语的运行被纷繁提上日程,以对话的方式启动人机交互的形式再一次性被业内所关注。

大概五六年前,自动音箱由于其人造言语对话的交互方式,掀起了一场自动音箱热潮,各大公司对其产品给予了厚望,但由于技术不够成熟,了解和对话才干不够强,造成了自动音箱一直难以作为群众生产品取得成功,而当下基于大模型的语义了解和对话才干有了质的提高,大家关于LUI(language user interface)又有了新的等候,都在等候新的时代来到,相似苹果经过反派性的电容屏和IOS代替nokia时代的电阻屏和塞班系统带来的手机体验改革开启移动互联网时代。因此,行业内兴起了LUI作为下一代交互体验改革的钻研和运行。

LUI引见,PPT:

但是,在开发以ChatGPT为代表的大模型作为大脑,对接下游服务的LUI运行时,遇到了一个新矛盾(以前交互方式恰恰雷同),那就是对用户友好,但对服务间集成不友好。人和系统的沟通和下达指令的言语是多变的,灵敏的,但是系统与系统之间的调用却宿愿是格局化的,稳固的。而大模型做到了了解用户多变的指令的同时,带来一个疑问,就是它自身的输入雷同会变得多变和不稳固,这就关于系统集成带来了很大的应战。为了处置这一矛盾,langchain这类框架,经过精心结构prompt以及专门设计“Output parsers”来处置各种各样的输入,当然也蕴含之前提到了几个库,如guidance,Guardrails,但基于prompt engineering的处置门路,有必定的毛病,首先,关于它是一个新物种,比拟生疏,有必定的学习门槛,其次,模型输入具备必定不确定性,随着类型复杂度越来越高,链路也越来越软弱,经常会由于边角疑问造成系统解体。为此,OpenAI自己也开发了function calls配置来优化大模型与系统的对接才干。

近日(7.20),微软在这一畛域又颁布了一款新的开源前端库TypeChat(),给后续开发者处置这类疑问的一个新思绪,它的一个翻新点是经过schema engineering代替了 prompt engineering,奇妙的借助了typescript的才干,开发者只有定义代表LUI运行所允许的用意的类型即可。这可以是便捷的情感分类的接口类型,也可以是更复杂的数据类型,如购物车或音乐运行程序的类型。例如,要在schema中减少额外的用意(intents),开发人员可以在可辨识联结(Discriminated Unions)减少额外的类型。为使schema具备档次性,开发人员可以经常使用 "meta-schema",依据用户输中选用一个或多个子schema。定义完类型后,TypeChat 搞定后续上班:

形式对比:

开发者结构prompt,给出示例,需要LLM以JSON格局输入,而后基于输入启动后续处置。

:Provide 3 suggestions for specific places to go to in Seattle on a rainy day. Respond in the form of JSON. The JSON should have the following forma

[{ "venue": "...", "description": "..." },{ "venue": "...", "description": "..." }]
{"venue": "Seattle Art Museum","description": "The Seattle Art Museum (SAM) is a world-class museum with a diverse collection of art from around the globe. It offers a great indoor activity for a rainy day, allowing you to explore various art exhibitions and displays, including contemporary art, African and Oceanic art, and European painting and sculpture."},{"venue": "Chihuly Garden and Glass","description": "Chihuly Garden and Glass is an extraordinary exhibition showcasing the breathtaking glass artwork of Dale Chihuly. Located at the Seattle Center, this indoor attraction offers a mesmerizing experience as you wander through vibrant glass sculptures and installations. The beautiful interplay of light and color will captivate your senses, making it a perfect rainy day destination."},{"venue": "Museum of Pop Culture","description": "The Museum of Pop Culture (MoPOP) is a vibrant museum dedicated to contemporary pop culture, music, science fiction, and more. It features engaging exhibits that celebrate music icons, explore science fiction themes, and delve into the world of video games. Whether you're a fan of music, movies, or pop culture in general, MoPOP offers an immersive and entertaining experience, making it an ideal choice on a rainy day."}]

开发者经常使用相熟的方式开发,定义类型,TypeChat帮你搞定外部细节。理想上,typechat应用了typescript自身才干,借助TypeScript编译器来处置covercase,能够很好消弭言语模型照应的一些尖利边缘,提高鲁棒性。关于开发者自身来讲,也可以基于原有开发形式编程,可进一步地启动数据加工和处置,到达1+1>2的成果。

Provide 3 suggestions for specific places to go to in Seattle on a rainy day. Respond strictly with JSON. The JSON should be compatible with the TypeScript typeResponsefrom the following:

interface Response {data: Array<{ venue: string, description: string }>;}
{"data": [{"venue": "Museum of Pop Culture","description": "Explore the fascinating world of popular culture through interactive exhibits, music memorabilia, and multimedia displays at the Museum of Pop Culture."},{"venue": "Seattle Art Museum","description": "Indulge in the diverse collection of artworks from around the world at the Seattle Art Museum, featuring both contemporary and classical pieces."},{"venue": "Pike Place Market","description": "Enjoy the vibrant atmosphere of Pike Place Market, where you can wander through covered stalls offering fresh produce, crafts, and delicious food from local vendors."}]}

应用TypeChat做情感剖析的例子:

// ./src/sentimentSchema.ts// The following is a schema definition for determining the sentiment of a some user input.export interface SentimentResponse {/** The sentiment of the text. */sentiment: "negative" | "neutral" | "positive";}// ./src/main.tsimport * as fs from "fs";import * as path from "path";import dotenv from "dotenv";import * as typechat from "typechat";import { SentimentResponse } from "./sentimentSchema";// Load environment variables.dotenv.config({ path: path.join(__dirname, "../.env") });// Create a language model based on the environment variables.const model = typechat.createLanguageModel(process.env);// Load up the contents of our "Response" schema.const schema = fs.readFileSync(path.join(__dirname, "sentimentSchema.ts"), "utf8");const translator = typechat.createJsonTranslator<SentimentResponse>(model, schema, "SentimentResponse");// Process requests interactively.typechat.processRequests(" 
  • 关注微信

本网站的文章部分内容可能来源于网络和网友发布,仅供大家学习与参考,如有侵权,请联系站长进行删除处理,不代表本网站立场,转载联系作者并注明出处:https://duobeib.com/diannaowangluoweixiu/5386.html

猜你喜欢

热门标签

洗手盆如何疏浚梗塞 洗手盆为何梗塞 iPhone提价霸占4G市场等于原价8折 明码箱怎样设置明码锁 苏泊尔电饭锅保修多久 长城画龙G8253YN彩电输入指令画面变暗疑问检修 彩星彩电解除童锁方法大全 三星笔记本培修点上海 液晶显示器花屏培修视频 燃气热水器不热水要素 热水器不上班经常出现3种处置方法 无氟空调跟有氟空调有什么区别 norltz燃气热水器售后电话 大连站和大连北站哪个离周水子机场近 热水器显示屏亮显示温度不加热 铁猫牌保险箱高效开锁技巧 科技助力安保无忧 创维8R80 汽修 a1265和c3182是什么管 为什么电热水器不能即热 标致空调为什么不冷 神舟培修笔记本培修 dell1420内存更新 青岛自来水公司培修热线电话 包头美的洗衣机全国各市售后服务预定热线号码2024年修缮点降级 创维42k08rd更新 空调为什么运转异响 热水器为何会漏水 该如何处置 什么是可以自己处置的 重庆华帝售后电话 波轮洗衣机荡涤价格 鼎新热水器 留意了!不是水平疑问! 马桶产生了这5个现象 方便 极速 邢台空调移机电话上门服务 扬子空调缺点代码e4是什么疑问 宏基4736zG可以装置W11吗 奥克斯空调培修官方 为什么突然空调滴水很多 乐视s40air刷机包 未联络视的提高方向 官网培修 格力空调售后电话 皇明太阳能电话 看尚X55液晶电视进入工厂形式和软件更新方法 燃气热水器缺点代码

热门资讯

关注我们

微信公众号