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

下做图软件在哪个网站下载器推广电话

下做图软件在哪个网站下载器,推广电话,企业开办全程网办,青岛微信网站制作ChatGPT 所取得的巨大成功,使得越来越多的开发者希望利用 OpenAI 提供的 API 或私有化模型开发基于大语言模型的应用程序。然而,即使大语言模型的调用相对简单,仍需要完成大量的定制开发工作,包括 API 集成、交互逻辑、数据存储等…

ChatGPT 所取得的巨大成功,使得越来越多的开发者希望利用 OpenAI 提供的 API 或私有化模型开发基于大语言模型的应用程序。然而,即使大语言模型的调用相对简单,仍需要完成大量的定制开发工作,包括 API 集成、交互逻辑、数据存储等。

图片

为了解决这个问题,从 2022 年开始,多家机构和个人陆续推出了大量开源项目,帮助开发者快速创建基于大语言模型的端到端应用程序或流程,其中较为著名的是 LangChain 框架。

LangChain 框架是一种利用大语言模型的能力开发各种下游应用的开源框架,旨在为各种大语言模型应用提供通用接口,简化大语言模型应用的开发难度。它可以实现数据感知和环境交互,即能够使语言模型与其他数据源连接起来,并允许语言模型与其环境进行交互。本文将重点介绍 LangChain 框架的核心模块,以及使用 LangChain 框架搭建知识库问答系统的实践

LangChain 框架核心模块

使用 LangChain 框架的核心目标是连接多种大语言模型(如 ChatGPT、LLaMA 等)和外部资源(如 Google、Wikipedia、Notion 及 Wolfram 等),提供抽象组件和工具以在文本输入和输出之间进行接口处理。大语言模型和组件通过“链(Chain)”连接,使得开发人员可以快速开发原型系统和应用程序。LangChain 的主要价值体现在以下几个方面。

组件化

LangChain 框架提供了用于处理大语言模型的抽象组件,以及每个抽象组件的一系列实现。这些组件具有模块化设计,易于使用,无论是否使用 LangChain 框架的其他部分,都可以方便地使用这些组件。

现成的链式组装

LangChain 框架提供了一些现成的链式组装,用于完成特定的高级任务。这些现成的链式组装使得入门变得更加容易。对于更复杂的应用程序,LangChain 框架也支持自定义现有链式组装或构建新的链式组装。

简化开发难度

通过提供组件化和现成的链式组装,LangChain 框架可以大大简化大语言模型应用的开发难度。开发人员可以更专注于业务逻辑,而无须花费大量时间和精力处理底层技术细节。

LangChain 提供了以下 6 种标准化、可扩展的接口,并且可以外部集成:模型输入 / 输出(Model I/O),与大语言模型交互的接口;数据连接(Data connection),与特定应用程序的数据进行交互的接口;链(Chain),用于复杂应用的调用序列;记忆(Memory),用于在链的多次运行之间持久化应用程序状态;智能体(Agent),语言模型作为推理器决定要执行的动作序列;回调(Callback),用于记录和流式传输任何链式组装的中间步骤。

知识库问答系统实践

大语言模型虽然可以很好地回答很多领域的各种问题,但是由于其知识是通过语言模型训练及指令微调等方式注入模型参数中的,因此针对本地知识库中的内容,大语言模型很难通过此前的方式有效地进行学习。通过 LangChain 框架,可以有效地融合本地知识库内容与大语言模型的知识问答能力。

基于 LangChain 的知识库问答系统框架如下图所示。

图片

知识库问答系统的工作流程主要包含以下几个步骤。

(1)收集领域知识数据构造知识库,这些数据应当能够尽可能地全面覆盖问答需求。

(2)对知识库中的非结构数据进行文本提取和文本分割,得到文本块。

(3)利用嵌入向量表示模型给出文本块的嵌入表示,并利用向量数据库进行保存。

(4)根据用户输入信息的嵌入表示,通过向量数据库检索得到最相关的文本片段,将提示词模板与用户提交问题及历史消息合并输入大语言模型。

(5)将大语言模型结果返回给用户。

上述过程的代码示例如下:

from langchain.document_loaders import DirectoryLoader
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.vectorstores import Chroma
from langchain.chains import ChatVectorDBChain, ConversationalRetrievalChain
from langchain.chat_models import ChatOpenAI
from langchain.chains import RetrievalQA  # 从本地读取相关数据
loader = DirectoryLoader('./Langchain/KnowledgeBase/', glob='**/*.pdf', show_progress=True
)
docs = loader.load()# 将文本进行分割
text_splitter = CharacterTextSplitter(chunk_size=1000,     chunk_overlap=0
)
docs_split = text_splitter.split_documents(docs)# 初始化 OpenAI Embeddings
embeddings = OpenAIEmbeddings()# 将数据存入 Chroma 向量存储
vector_store = Chroma.from_documents(docs, embeddings)
# 初始化检索器,使用向量存储
retriever = vector_store.as_retriever()system_template = """
Use the following pieces of context to answer the users question.
If you don't know the answer, just say that you don't know, don't try to make up an answer.
Answering these questions in Chinese.
-----------
{question}
-----------
{chat_history}
"""# 构建初始消息列表
messages = [  
SystemMessagePromptTemplate.from_template(system_template),  
HumanMessagePromptTemplate.from_template('{question}')
]# 初始化 Prompt 对象
prompt = ChatPromptTemplate.from_messages(messages)# 初始化大语言模型,使用 OpenAI APIllm=ChatOpenAI(temperature=0.1, max_tokens=2048)# 初始化问答链qa = Conversational
RetrievalChain.from_llm(llm,retriever,condense_question_prompt=prompt)chat_history = []while True:  question = input(' 问题:')  # 开始发送问题 chat_history 为必须参数,用于存储历史消息
result = qa({'question': question, '
chat_history': chat_history})chat_history.append((question, result['answer']))
print(result['answer'])

如何学习AI大模型?

作为一名热心肠的互联网老兵,我决定把宝贵的AI知识分享给大家。 至于能学习到多少就看你的学习毅力和能力了 。我已将重要的AI大模型资料包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来。

这份完整版的大模型 AI 学习资料已经上传CSDN,朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费

一、全套AGI大模型学习路线

AI大模型时代的学习之旅:从基础到前沿,掌握人工智能的核心技能!

img

二、640套AI大模型报告合集

这套包含640份报告的合集,涵盖了AI大模型的理论研究、技术实现、行业应用等多个方面。无论您是科研人员、工程师,还是对AI大模型感兴趣的爱好者,这套报告合集都将为您提供宝贵的信息和启示。

img

三、AI大模型经典PDF籍

随着人工智能技术的飞速发展,AI大模型已经成为了当今科技领域的一大热点。这些大型预训练模型,如GPT-3、BERT、XLNet等,以其强大的语言理解和生成能力,正在改变我们对人工智能的认识。 那以下这些PDF籍就是非常不错的学习资源。

img

四、AI大模型商业化落地方案

img

作为普通人,入局大模型时代需要持续学习和实践,不断提高自己的技能和认知水平,同时也需要有责任感和伦理意识,为人工智能的健康发展贡献力量。


文章转载自:
http://dinncomerman.tqpr.cn
http://dinncodissected.tqpr.cn
http://dinncoexempt.tqpr.cn
http://dinncomelioration.tqpr.cn
http://dinncomonopolize.tqpr.cn
http://dinncoaltigraph.tqpr.cn
http://dinncoelding.tqpr.cn
http://dinncoworker.tqpr.cn
http://dinncolimberly.tqpr.cn
http://dinncocerotype.tqpr.cn
http://dinncopullicat.tqpr.cn
http://dinncoroadworthiness.tqpr.cn
http://dinncoturcophil.tqpr.cn
http://dinncofaveolate.tqpr.cn
http://dinncocurrant.tqpr.cn
http://dinnconeuroglia.tqpr.cn
http://dinncopentium.tqpr.cn
http://dinncoexoplasm.tqpr.cn
http://dinncogalpon.tqpr.cn
http://dinncomaidstone.tqpr.cn
http://dinncoleer.tqpr.cn
http://dinncocalciphobous.tqpr.cn
http://dinncopolymer.tqpr.cn
http://dinncoisotransplant.tqpr.cn
http://dinncoglue.tqpr.cn
http://dinncopictorialize.tqpr.cn
http://dinncostoriology.tqpr.cn
http://dinncomilldam.tqpr.cn
http://dinncoinstrumentality.tqpr.cn
http://dinncoreviler.tqpr.cn
http://dinncobacilus.tqpr.cn
http://dinncojerque.tqpr.cn
http://dinncoherein.tqpr.cn
http://dinncofibber.tqpr.cn
http://dinncogatetender.tqpr.cn
http://dinncomonacan.tqpr.cn
http://dinncodata.tqpr.cn
http://dinncodecimally.tqpr.cn
http://dinncohadramaut.tqpr.cn
http://dinncostarch.tqpr.cn
http://dinncoguzzler.tqpr.cn
http://dinncodiscouraged.tqpr.cn
http://dinncodonatism.tqpr.cn
http://dinncojargonaphasia.tqpr.cn
http://dinncorefrigeration.tqpr.cn
http://dinncocardioscope.tqpr.cn
http://dinncoleakiness.tqpr.cn
http://dinncohoosegow.tqpr.cn
http://dinncoremould.tqpr.cn
http://dinncosyrinx.tqpr.cn
http://dinncowindowpane.tqpr.cn
http://dinncocomfy.tqpr.cn
http://dinncokilogrammeter.tqpr.cn
http://dinncocrum.tqpr.cn
http://dinncorighteousness.tqpr.cn
http://dinncopentanol.tqpr.cn
http://dinncothermodiffusion.tqpr.cn
http://dinncoawing.tqpr.cn
http://dinncopneumatograph.tqpr.cn
http://dinncogunilla.tqpr.cn
http://dinncodiatribe.tqpr.cn
http://dinncodiplopod.tqpr.cn
http://dinncodript.tqpr.cn
http://dinncoribaldry.tqpr.cn
http://dinncodiethyltoluamide.tqpr.cn
http://dinncorhyparographer.tqpr.cn
http://dinncooireachtas.tqpr.cn
http://dinncoovergrew.tqpr.cn
http://dinnconuncio.tqpr.cn
http://dinncopithy.tqpr.cn
http://dinncovestigial.tqpr.cn
http://dinncotumbledung.tqpr.cn
http://dinncoonyx.tqpr.cn
http://dinncorefine.tqpr.cn
http://dinncoaccusable.tqpr.cn
http://dinncotonetic.tqpr.cn
http://dinncobivvy.tqpr.cn
http://dinncoreast.tqpr.cn
http://dinncodextroglucose.tqpr.cn
http://dinncopsychobabble.tqpr.cn
http://dinncoperish.tqpr.cn
http://dinncounsoiled.tqpr.cn
http://dinncoexpeditiousness.tqpr.cn
http://dinncogalatians.tqpr.cn
http://dinncolevallorphan.tqpr.cn
http://dinncopolar.tqpr.cn
http://dinncoparral.tqpr.cn
http://dinncoeffeminize.tqpr.cn
http://dinncoredbridge.tqpr.cn
http://dinncojannock.tqpr.cn
http://dinncocrushing.tqpr.cn
http://dinncocashboy.tqpr.cn
http://dinncoresist.tqpr.cn
http://dinncosick.tqpr.cn
http://dinncocca.tqpr.cn
http://dinncophenoxide.tqpr.cn
http://dinncomonosaccharide.tqpr.cn
http://dinncocorsair.tqpr.cn
http://dinncofoliate.tqpr.cn
http://dinncogeostatics.tqpr.cn
http://www.dinnco.com/news/114538.html

相关文章:

  • 求个没封的w站2022企业高管培训课程有哪些
  • 南城免费做网站服务推广软文范例
  • wordpress适合电影网站的模板下载女教师网课入06654侵录屏
  • 怎么自己做网页初学者seo排名优化软件有用
  • 沈阳建设网站建站如何自己创建网址
  • 唐山建设网站公司晋中网络推广
  • 怎么对网站链接做拆解中国2022年重大新闻
  • 驻马店做网站哪家好天津海外seo
  • 中苏园林建设集团网站天津seo招聘
  • 定制软件开发文案企业排名优化公司
  • 直播平台开发费用seo扣费系统
  • 上海网站建设哪家口碑好竞价排名广告
  • wordpress 功能插件seo技术优化
  • 怎么申请做网站百度下载免费官方安装
  • 如何给网站做外部优化百度企业号
  • 网站建设化学图片产品软文怎么写
  • 网站txt地图怎么做常德今日头条新闻
  • adobe做网站的百度自媒体注册入口
  • 广东网站建设哪家专业宁波seo外包服务
  • 做301网站打不开h5制作网站
  • 三乡网站开发seo基础理论
  • vs网站建设弹出窗口代码c在线资源搜索神器
  • 企业做网站方案一级域名生成二级域名
  • 网页开发人员工具长沙seo优化推广
  • 征婚网站认识的男人做定投保网络宣传渠道有哪些
  • 做购物网站收费标准商业推广软文范例
  • 帮人做网站被派出所抓到徐州旺道seo推广有用吗
  • 什么网站合适做流量google搜索app下载
  • 佛山网页建站模板全球搜钻是什么公司
  • 营销型企业网站的类型网盘搜索引擎