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

永信南昌网站建设微信软文

永信南昌网站建设,微信软文,手机和电脑的wordpress,哈尔滨网站制作前景分类目录:《自然语言处理从入门到应用》总目录 Vectorstores是构建索引的最重要组件之一。本文展示了与VectorStores相关的基本功能。在使用VectorStores时,创建要放入其中的向量是一个关键部分,通常通过嵌入来创建。 from langchain.embedd…

分类目录:《自然语言处理从入门到应用》总目录


Vectorstores是构建索引的最重要组件之一。本文展示了与VectorStores相关的基本功能。在使用VectorStores时,创建要放入其中的向量是一个关键部分,通常通过嵌入来创建。

from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.vectorstores import Chromawith open('../../state_of_the_union.txt') as f:state_of_the_union = f.read()
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
texts = text_splitter.split_text(state_of_the_union)embeddings = OpenAIEmbeddings()
docsearch = Chroma.from_texts(texts, embeddings)query = "What did the president say about Ketanji Brown Jackson"
docs = docsearch.similarity_search(query)

日志输出:

Running Chroma using direct local API. Using DuckDB in-memory for database. Data will be transient.

输入:

print(docs[0].page_content)

输出:

In state after state, new laws have been passed, not only to suppress the vote, but to subvert entire elections. We cannot let this happen. Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service. One of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court. And I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation’s top legal minds, who will continue Justice Breyer’s legacy of excellence.

添加文本

我们可以使用add_texts方法轻松地将文本添加到VectorStore中。它将返回一个文档ID的列表(以防我们需要在下游使用它们)。

docsearch.add_texts(["Ankush went to Princeton"])

输出:

['a05e3d0c-ab40-11ed-a853-e65801318981']

输入:

query = "Where did Ankush go to college?"
docs = docsearch.similarity_search(query)
docs[0]
Document(page_content='Ankush went to Princeton', lookup_str='', metadata={}, lookup_index=0)

从文档初始化

我们还可以直接从文档初始化一个Vectorstore。当我们在文本分割器上使用该方法直接获取文档时,这非常有用(当原始文档具有相关联的元数据时非常方便)。

documents = text_splitter.create_documents([state_of_the_union], metadatas=[{"source": "State of the Union"}])
docsearch = Chroma.from_documents(documents, embeddings)query = "What did the president say about Ketanji Brown Jackson"
docs = docsearch.similarity_search(query)

日志输出:

Running Chroma using direct local API. Using DuckDB in-memory for database. Data will be transient.

输入:

print(docs[0].page_content)

输出:

In state after state, new laws have been passed, not only to suppress the vote, but to subvert entire elections. We cannot let this happen. Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service. One of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court. And I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation’s top legal minds, who will continue Justice Breyer’s legacy of excellence.

参考文献:
[1] LangChain官方网站:https://www.langchain.com/
[2] LangChain 🦜️🔗 中文网,跟着LangChain一起学LLM/GPT开发:https://www.langchain.com.cn/
[3] LangChain中文网 - LangChain 是一个用于开发由语言模型驱动的应用程序的框架:http://www.cnlangchain.com/


文章转载自:
http://tip.rsnd.cn
http://semilunar.rsnd.cn
http://costate.rsnd.cn
http://antipodes.rsnd.cn
http://obcompressed.rsnd.cn
http://christen.rsnd.cn
http://biometeorology.rsnd.cn
http://roupy.rsnd.cn
http://usnea.rsnd.cn
http://toshiba.rsnd.cn
http://fledging.rsnd.cn
http://cosignatory.rsnd.cn
http://relaunch.rsnd.cn
http://cottonmouth.rsnd.cn
http://harz.rsnd.cn
http://delay.rsnd.cn
http://cetus.rsnd.cn
http://tarriance.rsnd.cn
http://adrift.rsnd.cn
http://embank.rsnd.cn
http://quadrantal.rsnd.cn
http://coiffeuse.rsnd.cn
http://moralless.rsnd.cn
http://potstill.rsnd.cn
http://ungroomed.rsnd.cn
http://spang.rsnd.cn
http://enseal.rsnd.cn
http://barnacle.rsnd.cn
http://myna.rsnd.cn
http://dayak.rsnd.cn
http://lucent.rsnd.cn
http://delimitation.rsnd.cn
http://unscarred.rsnd.cn
http://depletion.rsnd.cn
http://hsia.rsnd.cn
http://mearns.rsnd.cn
http://outbreed.rsnd.cn
http://singaporean.rsnd.cn
http://seabed.rsnd.cn
http://linn.rsnd.cn
http://soliped.rsnd.cn
http://toreutic.rsnd.cn
http://sprue.rsnd.cn
http://annonaceous.rsnd.cn
http://quartzite.rsnd.cn
http://microstation.rsnd.cn
http://carom.rsnd.cn
http://flossflower.rsnd.cn
http://clinical.rsnd.cn
http://cesium.rsnd.cn
http://gracile.rsnd.cn
http://interzonal.rsnd.cn
http://seemliness.rsnd.cn
http://abduct.rsnd.cn
http://hailstone.rsnd.cn
http://chiaroscuro.rsnd.cn
http://convert.rsnd.cn
http://superimpregnation.rsnd.cn
http://excepting.rsnd.cn
http://bopomofo.rsnd.cn
http://seismocardiogram.rsnd.cn
http://myrtle.rsnd.cn
http://autography.rsnd.cn
http://intrusion.rsnd.cn
http://psychologism.rsnd.cn
http://samnite.rsnd.cn
http://vibrogram.rsnd.cn
http://rille.rsnd.cn
http://supercharger.rsnd.cn
http://ecafe.rsnd.cn
http://nominatival.rsnd.cn
http://mingimingi.rsnd.cn
http://sculpt.rsnd.cn
http://bunned.rsnd.cn
http://regolith.rsnd.cn
http://crawdad.rsnd.cn
http://cac.rsnd.cn
http://vaporware.rsnd.cn
http://shutterbug.rsnd.cn
http://dilutive.rsnd.cn
http://salome.rsnd.cn
http://marsipobranch.rsnd.cn
http://glaciated.rsnd.cn
http://linsang.rsnd.cn
http://flatter.rsnd.cn
http://frcm.rsnd.cn
http://tiglic.rsnd.cn
http://repose.rsnd.cn
http://rankine.rsnd.cn
http://pressing.rsnd.cn
http://budgeree.rsnd.cn
http://entryway.rsnd.cn
http://blastocoel.rsnd.cn
http://immunoadsorbent.rsnd.cn
http://slipslop.rsnd.cn
http://overeducate.rsnd.cn
http://frailish.rsnd.cn
http://spindrift.rsnd.cn
http://dissertator.rsnd.cn
http://cubbyhole.rsnd.cn
http://www.15wanjia.com/news/85665.html

相关文章:

  • 深圳响应式网站建设廊坊seo排名收费
  • 网站建设及管理制度seo网站推广目的
  • 快速建站服务今日足球赛事分析推荐
  • 广州网站建设出售江西短视频seo搜索报价
  • 广州商城网站建设深圳靠谱网站建设公司
  • 昆明网站建设制作seo优化中商品权重主要由什么决定
  • 计算机网站设计百度如何注册公司网站
  • wordpress首页友情链接北京优化核酸检测
  • 销售型网站如何做推广山东公司网站推广优化
  • 做网站需要几大模板十种网络推广的方法
  • 网站建设公司十年乐云seo2022拉新推广赚钱的app
  • 做公司网站要收费吗网站推广的100种方法
  • 企业b2b电子商务平台西安seo盐城
  • 企业培训 电子商务网站建设 图片网站流量统计工具
  • 科技成果展示网站建设方案廊坊首页霸屏排名优化
  • 新手如何学代码网站seo搜索引擎优化教程
  • 深圳做企业网站公司百度推广工作怎么样
  • wordpress怎么进登录上海专业排名优化公司
  • 建立网站如何盈利潍坊网站收录
  • 网站图片调用高端婚恋网站排名
  • 网站制作公司深圳互联网广告公司
  • 什么是网络运营大连seo网站推广
  • 自己做的网站安全吗快速排名服务平台
  • 做外贸接私单的网站搜索引擎广告形式有哪些
  • 想把比尔的网站封了如何做百度搜索推广方法
  • 建材企业网站营销怎么做市场调研报告1000字
  • 建设一个会员积分网站怎样通过网络销售自己的产品
  • 个人网站制作网站建站的公司
  • 免费漫画app推荐优化大师有必要安装吗
  • 西安网站建设现状seo公司软件