做图片网站电脑自带的做网站叫什么

张小明 2026/1/10 8:06:28
做图片网站,电脑自带的做网站叫什么,给网站做镜像,智慧团建注册登录入口电脑版本文我们将讨论GraphRAG#xff08;Graph-based Retrieval Augmented Generation#xff09;的实现流程#xff0c;其中使用OpenAI进行自然语言处理#xff0c;使用neo4j作为图数据库。在这个流程中#xff0c;我们将展示#xff1a; 首先将文本转换为图结构然后将图结构…本文我们将讨论GraphRAGGraph-based Retrieval Augmented Generation的实现流程其中使用OpenAI进行自然语言处理使用neo4j作为图数据库。在这个流程中我们将展示首先将文本转换为图结构然后将图结构存储在neo4j中最后提取用户问题中的实体使用提取到的实体检索相关的实体和他们的关系再借助llm生成回答Marie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who conducted pioneering research on radioactivity.She was the first woman to win a Nobel Prize, the first person to win a Nobel Prize twice, and the only person to win a Nobel Prize in two scientific fields.Her husband, Pierre Curie, was a co-winner of her first Nobel Prize, making them the first-ever married couple to win the Nobel Prize and launching the Curie family legacy of five Nobel Prizes.She was, in 1906, the first woman to become a professor at the University of Paris.将上述文本使用OpenAI将文本转换为图表示并存储在neo4j中在上图中紫色的节点(df48cdaf)代表文档红色节点(Nobel Prize)诺贝尔奖两个蓝色的节点代表人名玛丽·居里、皮埃尔·居里灰色的代表(University Of Paris)巴黎大学。其中文档和其他所有节点的关系是提及(mentions)。一、GraphRAG实现为了快速了解GraphRAG背后的逻辑可以使用OpenAi api、neo4j sandbox在快速开始实验安装及导入包!pip install langchain!pip install -U langchain-community!pip install sentence-transformers!pip install faiss-gpu!pip install pypdf!pip install faiss-cpu!pip install langchain-openai!pip install langchain-experimental!pip install json-repair!pip install neo4jfrom langchain_openai importChatOpenAIfrom langchain.chainsimportRetrievalQAfrom langchain.document_loadersimportPyPDFLoaderfrom langchain.text_splitterimportCharacterTextSplitterfrom langchain.embeddingsimportHuggingFaceEmbeddingsfrom langchain.vectorstoresimportFAISSfrom langchain_core.documentsimportDocumentfrom langchain_openai importOpenAIEmbeddingsfrom langchain_community.graphsimportNeo4jGraphfrom langchain_experimental.graph_transformersimportLLMGraphTransformerfrom langchain_community.chat_modelsimportChatOllamafrom langchain_community.vectorstoresimportNeo4jVectorfrom langchain_core.promptsimportChatPromptTemplatefrom pydantic importBaseModel, Fieldfrom langchain_core.runnablesimportRunnablePassthroughfrom langchain_core.output_parsersimportStrOutputParser配置neo4j的连接graph Neo4jGraph( url bolt://44.204.252.192 , usernameneo4j, #default passwordquarterdeck-gross-dials #change accordingly)使用OpenAI将文本转换为Graph将文本转换为documenttext Marie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who conducted pioneering research on radioactivity.She was the first woman to win a Nobel Prize, the first person to win a Nobel Prize twice, and the only person to win a Nobel Prize in two scientific fields.Her husband, Pierre Curie, was a co-winner of her first Nobel Prize, making them the first-ever married couple to win the Nobel Prize and launching the Curie family legacy of five Nobel Prizes.She was, in 1906, the first woman to become a professor at the University of Paris.documents [Document(page_contenttext)]加载大模型将文本转换为graphllm ChatOpenAI(temperature0, model_namegpt-4-turbo,api_keysk-FgKk2OO5RYzYRJEf7eaMytOLsuIbZecGxaJvRnWDg1GCIkNh)llm_transformer_filtered LLMGraphTransformer(llmllm)graph_documents llm_transformer_filtered.convert_to_graph_documents(documents)graph_documents的内容如下[GraphDocument(nodes[Node(idMarie Curie, typePerson, properties{}), Node(idPierre Curie, typePerson, properties{}), Node(idUniversity Of Paris, typeOrganization, properties{}), Node(idNobel Prize, typeAward, properties{})], relationships[Relationship(sourceNode(idMarie Curie, typePerson, properties{}), targetNode(idNobel Prize, typeAward, properties{}), typeWINNER, properties{}), Relationship(sourceNode(idMarie Curie, typePerson, properties{}), targetNode(idUniversity Of Paris, typeOrganization, properties{}), typePROFESSOR, properties{}), Relationship(sourceNode(idPierre Curie, typePerson, properties{}), targetNode(idNobel Prize, typeAward, properties{}), typeCO-WINNER, properties{})], sourceDocument(metadata{}, page_content\nMarie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who conducted pioneering research on radioactivity.\nShe was the first woman to win a Nobel Prize, the first person to win a Nobel Prize twice, and the only person to win a Nobel Prize in two scientific fields.\nHer husband, Pierre Curie, was a co-winner of her first Nobel Prize, making them the first-ever married couple to win the Nobel Prize and launching the Curie family legacy of five Nobel Prizes.\nShe was, in 1906, the first woman to become a professor at the University of Paris.\n))]将生成的graph存储在neo4jgraph.add_graph_documents( graph_documents, baseEntityLabelTrue, include_sourceTrue )为了复杂查询在neo4j中创建embeddingembed OpenAIEmbeddings(modeltext-embedding-3-large,base_urlhttps://xiaoai.plus/v1,api_keysk-FgKk2OO5RYzYRJEf7eaMytOLsuIbZecGxaJvRnWDg1GCIkNh)vector_index Neo4jVector.from_existing_graph( embeddingembed, search_typehybrid, node_labelDocument, text_node_properties[text], embedding_node_propertyembedding, urlbolt://44.204.252.192, usernameneo4j, #default passwordquarterdeck-gross-dials #change accordingly)vector_retriever vector_index.as_retriever()此时在neo4j中可以看到如下数据{ identity: 0,labels: [ Document ],properties: { id: df48cdafbdaada2de04aaeb7c6a271a0, text: Marie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who conducted pioneering research on radioactivity....., embedding: [ 0.013757660053670406, -0.035230763256549835, -0.014454838819801807, ... ] },elementId: 4:56545626-8926-4df0-bdb3-73bbd4de10d6:0}{identity: 1,labels: [ Person, __Entity__ ],properties: { id: Marie Curie },elementId: 4:56545626-8926-4df0-bdb3-73bbd4de10d6:1}在neo4j中查询实体一旦我们将graph存储在了neo4j中我们可以提取用户问题中的实体 并在graph中查找相关的实体及其关系定义从文本中提取实体的模型class Entities(BaseModel): names: list[str] Field(..., descriptionAll entities from the text)定义提取实体的提示词prompt ChatPromptTemplate.from_messages([ (system, Extract organization and person entities from the text.), (human, Extract entities from: {question}) ])结合提示词和llm创建提取实体的链输出结果将是一个结构化的匹配实体的模型entity_chain prompt | llm.with_structured_output(Entities, include_rawTrue)response entity_chain.invoke({question: Who are Marie Curie and Pierre Curie?})entities response[raw].tool_calls[0][args][names]response 内容如下{raw: AIMessage(content, additional_kwargs{tool_calls: [{id: chatcmpl-WKYa1IBDY3cBqBgp8JbP6KtvlHniV, function: {arguments: {names:[Marie Curie,Pierre Curie]}, name: Entities}, type: function}], refusal: None}, response_metadata{token_usage: {completion_tokens: 13, prompt_tokens: 72, total_tokens: 85, completion_tokens_details: None, prompt_tokens_details: None}, model_name: gpt-4-turbo, system_fingerprint: fp_5b26d85e12, finish_reason: stop, logprobs: None}, idrun-41e2ac51-9573-4366-bc80-3080bd464fa6-0, tool_calls[{name: Entities, args: {names: [Marie Curie, Pierre Curie]}, id: chatcmpl-WKYa1IBDY3cBqBgp8JbP6KtvlHniV, type: tool_call}], usage_metadata{input_tokens: 72, output_tokens: 13, total_tokens: 85, input_token_details: {}, output_token_details: {}}), parsed: Entities(names[Marie Curie, Pierre Curie]), parsing_error: None}迭代提取的实体在neo4j数据库中查询其关联实体及关系graph_data for entity in entities: query_response graph.query( MATCH (p:Person {id: $entity})-[r]-(e) RETURN p.id AS source_id, type(r) AS relationship, e.id AS target_id LIMIT 50, {entity: entity} ) graph_data \n.join([f{el[source_id]} - {el[relationship]} - {el[target_id]} for el in query_response])graph_datagraph_data 内容如下Marie Curie - WINNER - Nobel PrizeMarie Curie - PROFESSOR - University Of ParisPierre Curie - CO-WINNER - Nobel Prize使用向量搜索vector_data [el.page_content for el in vector_retriever.invoke( Who are Marie Curie and Pierre Curie?)]vector_datavector_data内容如下[\ntext: \nMarie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who conducted pioneering research on radioactivity.\nShe was the first woman to win a Nobel Prize, the first person to win a Nobel Prize twice, and the only person to win a Nobel Prize in two scientific fields.\nHer husband, Pierre Curie, was a co-winner of her first Nobel Prize, making them the first-ever married couple to win the Nobel Prize and launching the Curie family legacy of five Nobel Prizes.\nShe was, in 1906, the first woman to become a professor at the University of Paris.\n]结合图搜索和向量搜索结果生成回答context fGraph data: {graph_data}\nVector data: {#Document .join(vector_data)}定义提示词模板为了基于上下文生成回答template Answer the question based only on the following context:{context}Question: {question}Answer:使用模板创建提示词这将采用上下文和提问作为输入prompt ChatPromptTemplate.from_template(template)创建处理链:使用上述生成的结果作为上下文输入应用提示词模板生成最终问题使用llm生成回答使用StrOutputParser格式化输出为字符串chain ( { context: lambda input: context, # Generate context from the question question: RunnablePassthrough(), # Pass the question through without modification } | prompt # Apply the prompt template | llm # Use the language model to answer the question based on context | StrOutputParser() # Parse the models response as a string )当输入问题Who are Marie Curie and Pierre Curie?最终结果如下Marie Curie was a Polish and naturalised-French physicist and chemist known for her research on radioactivity. She was the first woman to win a Nobel Prize, the first person to win it twice, and the only person to win in two scientific fields. She also became the first woman professor at the University of Paris. Pierre Curie, her husband, was a co-winner of her first Nobel Prize. Together, they were the first married couple to win the Nobel Prize.二、结果比较不使用graphRGA的输出结果llm ChatOpenAI(temperature0, model_namegpt-4-turbo,base_urlhttps://xiaoai.plus/v1,api_keysk-FgKk2OO5RYzYRJEf7eaMytOLsuIbZecGxaJvRnWDg1GCIkNh)response llm.invoke(Who are Marie Curie and Pierre Curie?)print(response) plaintext Marie Curie and Pierre Curie were a married couple who were both pioneering scientists in the field of radioactivity. Marie Curie, originally from Poland, was the first woman to win a Nobel Prize and the only person to win Nobel Prizes in two different scientific fields, physics and chemistry. Pierre Curie was a French physicist who made significant contributions to the study of crystallography, magnetism, and radioactivity. Together, they discovered the elements polonium and radium, and conducted groundbreaking research on the properties of radioactive materials. Their work laid the foundation for the development of nuclear physics and the use of radiation in medicine.使用基于向量的RAG的输出结果text Marie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who conducted pioneering research on radioactivity.She was the first woman to win a Nobel Prize, the first person to win a Nobel Prize twice, and the only person to win a Nobel Prize in two scientific fields.Her husband, Pierre Curie, was a co-winner of her first Nobel Prize, making them the first-ever married couple to win the Nobel Prize and launching the Curie family legacy of five Nobel Prizes.She was, in 1906, the first woman to become a professor at the University of Paris.docs [Document(page_contenttext)]embeddings OpenAIEmbeddings(modeltext-embedding-3-largeapi_keysk-FgKk2OO5RYzYRJEf7eaMytOLsuIbZecGxaJvRnWDg1GCIkNh)# Create FAISS vector storevectorstore FAISS.from_documents(docs, embeddings)# Save and reload the vector storevectorstore.save_local(faiss_index_)persisted_vectorstore FAISS.load_local(faiss_index_, embeddings, allow_dangerous_deserializationTrue)# Create a retrieverretriever persisted_vectorstore.as_retriever()result qa.invoke(Who are Marie Curie and Pierre Curie?)print(result) plaintext Marie Curie was a Polish and naturalised-French physicist and chemist known for her research on radioactivity. She was the first woman to win a Nobel Prize, the first person to win twice, and the only person to win in two different scientific fields. Pierre Curie was her husband and a co-winner of her first Nobel Prize. Together, they conducted significant research in the field of radioactivity, and their collaboration marked them as the first-ever married couple to win the Nobel Prize.如何学习大模型 AI 由于新岗位的生产效率要优于被取代岗位的生产效率所以实际上整个社会的生产效率是提升的。但是具体到个人只能说是“最先掌握AI的人将会比较晚掌握AI的人有竞争优势”。这句话放在计算机、互联网、移动互联网的开局时期都是一样的道理。我在一线互联网企业工作十余年里指导过不少同行后辈。帮助很多人得到了学习和成长。我意识到有很多经验和知识值得分享给大家也可以通过我们的能力和经验解答大家在人工智能学习中的很多困惑所以在工作繁忙的情况下还是坚持各种整理和分享。但苦于知识传播途径有限很多互联网行业朋友无法获得正确的资料得到学习提升故此将并将重要的AI大模型资料包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来。第一阶段10天初阶应用该阶段让大家对大模型 AI有一个最前沿的认识对大模型 AI 的理解超过 95% 的人可以在相关讨论时发表高级、不跟风、又接地气的见解别人只会和 AI 聊天而你能调教 AI并能用代码将大模型和业务衔接。大模型 AI 能干什么大模型是怎样获得「智能」的用好 AI 的核心心法大模型应用业务架构大模型应用技术架构代码示例向 GPT-3.5 灌入新知识提示工程的意义和核心思想Prompt 典型构成指令调优方法论思维链和思维树Prompt 攻击和防范…第二阶段30天高阶应用该阶段我们正式进入大模型 AI 进阶实战学习学会构造私有知识库扩展 AI 的能力。快速开发一个完整的基于 agent 对话机器人。掌握功能最强的大模型开发框架抓住最新的技术进展适合 Python 和 JavaScript 程序员。为什么要做 RAG搭建一个简单的 ChatPDF检索的基础概念什么是向量表示Embeddings向量数据库与向量检索基于向量检索的 RAG搭建 RAG 系统的扩展知识混合检索与 RAG-Fusion 简介向量模型本地部署…第三阶段30天模型训练恭喜你如果学到这里你基本可以找到一份大模型 AI相关的工作自己也能训练 GPT 了通过微调训练自己的垂直大模型能独立训练开源多模态大模型掌握更多技术方案。到此为止大概2个月的时间。你已经成为了一名“AI小子”。那么你还想往下探索吗为什么要做 RAG什么是模型什么是模型训练求解器 损失函数简介小实验2手写一个简单的神经网络并训练它什么是训练/预训练/微调/轻量化微调Transformer结构简介轻量化微调实验数据集的构建…第四阶段20天商业闭环对全球大模型从性能、吞吐量、成本等方面有一定的认知可以在云端和本地等多种环境下部署大模型找到适合自己的项目/创业方向做一名被 AI 武装的产品经理。硬件选型带你了解全球大模型使用国产大模型服务搭建 OpenAI 代理热身基于阿里云 PAI 部署 Stable Diffusion在本地计算机运行大模型大模型的私有化部署基于 vLLM 部署大模型案例如何优雅地在阿里云私有部署开源大模型部署一套开源 LLM 项目内容安全互联网信息服务算法备案…学习是一个过程只要学习就会有挑战。天道酬勤你越努力就会成为越优秀的自己。如果你能在15天内完成所有的任务那你堪称天才。然而如果你能完成 60-70% 的内容你就已经开始具备成为一名大模型 AI 的正确特征了。这份完整版的大模型 AI 学习资料已经上传CSDN朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费】
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

响应式网站都有哪些国内外贸平台有哪些

一、申请失败处理:错误类型错误信息可能原因解决方案解决时间配额超限​Instance limit exceeded实例数超限申请提升配额1-2天权限不足​UnauthorizedOperationIAM权限问题检查IAM策略10分钟支付问题​Payment verification failed支付方式无效更新支付信息5分钟资源…

张小明 2026/1/2 14:10:13 网站建设

凡客网站建立商业网站规划

文章目录1. 避免共享状态(无状态/不可变)2.线程封闭3. 加锁同步常用方式:4. 使用线程安全的类/容器5. 使用原子操作(CAS)6. 合理设计并发模型7. 使用高级并发工具解决线程安全问题,核心目标是确保多个线程在…

张小明 2026/1/7 16:47:04 网站建设

网站建设找哪里构建网站需要什么意思

深夜的实验室里,咖啡杯沿已经冷透,屏幕上闪烁的光标仿佛在嘲笑我的写作瓶颈——这是每个研究者都熟悉的场景,直到我发现了一种不同的可能性。深夜两点,实验室里只剩我一人。面前是堆积如山的参考文献和只写了三段的论文初稿。导师…

张小明 2026/1/8 21:46:02 网站建设

手机网站相关做网站图片怎么找

三数之和:从 “暴力狂” 到 “双指针大师” 的修炼之路 🚀 一、LeetCode 第 15 题:三数之和 先来看看LeetCode上给出的题目描述: 给你一个整数数组 nums ,判断是否存在三元组 [nums[i], nums[j], nums[k]] 满足 i ! j、…

张小明 2026/1/9 0:00:49 网站建设

我的世界找建筑网站做网站能赚钱

Excalidraw 构建 AI 增强型协作生态:从手绘白板到“说即所得”的智能绘图 在技术团队的日常中,你是否经历过这样的场景? 一场架构评审会议即将开始,主讲人还在焦头烂额地拖拽框线、调整对齐、反复修改颜色风格;产品经…

张小明 2026/1/4 7:42:12 网站建设

呼市地区做网站公司php网站开发优化

多GPU分布式推理实战指南:从零搭建高性能AI推理系统 【免费下载链接】Qwen3-30B-A3B Qwen3-30B-A3B具有以下特点: 类型:因果语言模型 训练阶段:预训练和后训练 参数数量:总计 305 亿,其中已激活 33 亿 参数…

张小明 2026/1/9 10:58:03 网站建设