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

如何在LlamaIndex中使用RAG?

如何在LlamaIndex中使用RAG

img

什么是 Llama-Index

LlamaIndex 是一个数据框架,用于帮助基于 LLM 的应用程序摄取、构建结构和访问私有或特定领域的数据。

如何使用 Llama-Index ?

基本用法是一个五步流程,将我们从原始、非结构化数据导向基于该数据生成内容的LLM。

    1. 加载文档
    1. 解析文档到 LlamaIndex 的 Node 节点中
    1. 构建索引
    1. 解析索引
    1. 解析响应

安装需要的依赖包

 !pip install llama-index -qU!pip install -q openai!pip install pypdf!pip install doc2txt!pip install -qU llama-cpp-python!pip install transformers!pip install accelerate

导入需要的依赖

 import osimport openaifrom getpass import getpass#import loggingimport sysfrom pprint import pprint#logging.basicConfig(stream=sys.stdout, level=logging.INFO)logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))#from llama_index import(VectorStoreIndex,SimpleDirectoryReader,load_index_from_storage,StorageContext,ServiceContext,Document)​from llama_index.llms import OpenAI,HuggingFaceLLMfrom llama_index.prompts import PromptTemplatefrom llama_index.text_splitter import SentenceSplitterfrom llama_index.embeddings import OpenAIEmbedding,HuggingFaceEmbeddingfrom llama_index.schema import MetadataModefrom llama_index.postprocessor import MetadataReplacementPostProcessor

什么是 Document?

Document是一个容器,用来保存来自各种来源的数据,比如PDFAPI 输出或从数据库中检索到的数据。

 documents = SimpleDirectoryReader('./Data/').load_data()print(len(documents))pprint(documents)

加载完成后,这个 pdf 被转换为长度为 12 的数组.

 documents[0].get_content()​## ResponseFace Recognition System Using PythonThis article was published as a part of the Data Science Blogathon.IntroductionFace recognition is different from face detection. In face detection, we had only detected the location ofhuman faces, and we recognized the identity of faces in the face recognition task.In this article, we are going to build a face recognition system using python with the help of facerecognition library .There are many algorithms available in the market for face recognition. This broad computer visionchallenge is detecting faces from videos and pictures. Many applications can be built on top of recognitionsystems. Many big companies are adopting recognition systems for their security and authenticationpurposes.Use Cases of Recognition SystemsFace recognition systems are widely used in the modern era, and many new innovative systems are built ontop of recognition systems.There are a few used cases :Finding Missing PersonIdentifying accounts on social mediaRecognizing Drivers in CarsSchool Attendance SystemSeveral methods and algorithms implement facial recognition systems depending on the performance andaccuracy.Traditional Face Recognition AlgorithmTraditional face recognition algorithms don’t meet modern-day’s facial recognition standards. They weredesigned to recognize faces using old conventional algorithms.OpenCV provides some traditional facial Recognition Algorithms.EigenfacesScale Invariant Feature Transform (SIFT)Fisher facesLocal Binary Patterns Histograms (LBPH)COMPUTER VISIONIMAGE ANALYSISINTERMEDIATEPYTHONdocuments[0].metadata​## 响应{'file_path': 'Data/chinahistory.txt','file_name': 'chinahistory.txt','file_type': 'text/plain','file_size': 977274,'creation_date': '2023-12-18','last_modified_date': '2023-12-05','last_accessed_date': '2023-12-18'}

设置 llm

 from llama_index.llms import HuggingFaceLLMfrom llama_index.prompts import PromptTemplatellm = HuggingFaceLLM(model_name="HuggingFaceH4/zephyr-7b-beta",tokenizer_name="HuggingFaceH4/zephyr-7b-beta",#query_wrapper_prompt=PromptTemplate("<|system|>Please check if the following pieces of context has any mention of the keywords provided in the question.If not ten say that you do not know the answer.Please do not make up your own answer.</s>\n<|user|>\nQuestion:{query_str}</s>\n<|assistant|>\n"),# query_wrapper_prompt=PromptTemplate(template),context_window=4096,max_new_tokens=512,model_kwargs={'trust_remote_code':True},generate_kwargs={"temperature": 0.0},device_map="auto",)

配置 embedding Model

 from llama_index.embeddings import resolve_embed_modelfrom llama_index.embeddings.huggingface import HuggingFaceEmbedding#embed_model = resolve_embed_model("local:BAAI/bge-large-en-v1.5")embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-large-en-v1.5")

在LlamaIndex中 Node 是什么

LlamaIndex 中的 Node 对象表示源文档的“块”或部分。

这可能是一个文本块、一幅图像或其他类型的数据。类似于 DocumentsNodes 也包含与其他节点的元数据和关系信息。

LlamaIndex 中,Nodes 被认为是一等公民。

这意味着可以直接定义 Nodes 及其所有属性。

或者也可以使用 NodeParser 类将源Document解析为Node。默认情况下,从文档派生的每个节点都会继承相同的元数据。例如,文档中的file_name字段会传播到每个节点。

视特定的使用情况和数据结构,选择将整个 Document 对象发送到索引还是在索引之前将 Document 转换为 Node 对象取决于自己。

  1. 将整个Document对象发送至索引:这种方法适用于将整个文档作为单个单位进行维护。当您的文档相对较短或不同部分之间的上下文重要时这可能会更好。
  2. 在索引之前将Document转换为Node对象:当的文档很长且希望在索引之前将其拆分成较小块(或节点)时,这种方法很实用。当想要检索文档特定部分而非整个文档时这可能会更好。

节点解析和索引化(基于句子窗口方法)

SentenceWindowNodeParser 类旨在将文档解析为节点(句子),并为每个节点捕获周围句子的窗口。

这对于上下文感知的文本处理非常有用,通过理解句子周围的背景可以提供有价值的见解。

  • Node:表示文本的单元,这里指一句话。
  • Window:围绕特定句子的若干句组成的范围。例如,如果窗口大小为3,并且当前句是第5句,则该窗口会捕获第2至第8句。
  • Metadata:与节点相关联的额外信息,如周围句子的窗口。

工作机制

当我们使用from_defaults方法创建一个SentenceWindowNodeParser实例时,使用了 custom_sentence_splitter(根据 "\n", "\n-", 或 "\n" 分隔文本)以及指定的参数(window_size=3, include_prev_next_rel=True, include_metadata=True),我们将设置一个解析器来按照以下方式处理文档:

  • 每个文档的文本将使用自定义分隔符分为句子。
  • 对于每个句子,生成一个节点。
  • 该节点将包含捕获其两侧三个句子的元数据。
  • 此外,每个节点还会引用其前后的句子。
  • 使用一个文档列表调用 get_nodes_from_documents 将返回一组这些节点,每个代表一个句子,丰富了指定的元数据和关系。
 #create senetence window node parser with default settingsfrom llama_index.node_parser import SentenceWindowNodeParser,SimpleNodeParsersentence_node_parser = SentenceWindowNodeParser.from_defaults(window_size=3,window_metadata_key="window",original_text_metadata_key="original_text")#base_node_parser = SentenceSplitter(llm=llm)base_node_parser = SimpleNodeParser()#nodes = sentence_node_parser.get_nodes_from_documents(documents)base_nodes = base_node_parser.get_nodes_from_documents(documents)#print(f"SENTENCE NODES :\n {nodes[10]}")print(f"BASE NODES :\n {base_nodes[10]}")SENTENCE NODES :Node ID: 8418b939-dc08-42a6-8ee1-821e46f7a2a1Text: Traditional Face Recognition Algorithm Traditional facerecognition algorithms don’t meet modern-day’s facial recognitionstandards.BASE NODES :Node ID: 7a94495b-2f49-4cc4-8fd4-87f5fb0f645eText: Now let’s test the model prediction using text in differentlanguages. def predict(text): x = cv.transform([text]).toarray() #converting text to bag of words model (Vector) lang = model.predict(x)# predicting the language lang = le.inverse_transform(lang) # findingthe language corresponding the the predicted value print("The langaugeis in",l...dict(nodes[10]) # 由于没有执行索引操作,因此embedding为 None。​#### {'id_': '8418b939-dc08-42a6-8ee1-821e46f7a2a1','embedding': None,'metadata': {'window': 'Many big companies are adopting recognition systems for their security and authentication\npurposes.\n Use Cases of Recognition Systems\nFace recognition systems are widely used in the modern era, and many new innovative systems are built on\ntop of recognition systems.\n There are a few used cases :\nFinding Missing Person\nIdentifying accounts on social media\nRecognizing Drivers in Cars\nSchool Attendance System\nSeveral methods and algorithms implement facial recognition systems depending on the performance and\naccuracy.\n Traditional Face Recognition Algorithm\nTraditional face recognition algorithms don’t meet modern-day’s facial recognition standards.  They were\ndesigned to recognize faces using old conventional algorithms.\n OpenCV provides some traditional facial Recognition Algorithms.\n','original_text': 'Traditional Face Recognition Algorithm\nTraditional face recognition algorithms don’t meet modern-day’s facial recognition standards. ','page_label': '1','file_name': 'face-recognition-system-using-python.pdf','file_path': 'Data/face-recognition-system-using-python.pdf','file_type': 'application/pdf','file_size': 465666,'creation_date': '2023-12-21','last_modified_date': '2023-12-21','last_accessed_date': '2023-12-21'},'excluded_embed_metadata_keys': ['file_name','file_type','file_size','creation_date','last_modified_date','last_accessed_date','window','original_text'],'excluded_llm_metadata_keys': ['file_name','file_type','file_size','creation_date','last_modified_date','last_accessed_date','window','.......'}

LlamaIndex 中的 IndexNode 是什么?

IndexNode 是在 LlamaIndex 中使用的节点对象。

它代表了存储在索引中的原始文档块。索引是一种数据结构,允许快速检索与用户查询相关的上下文,这对于“检索增强生成”(RAG)用例至关重要。

从根本上讲,“IndexNode”继承自“TextNode”的属性,意味着它主要代表文本内容。

IndexNode 的区别特征在于其 index_id 属性。这个 index_id 充当一个唯一标识符或对另一个对象的引用,使得节点能够指向系统内的其他实体。

这种引用功能在文本内容之上增加了一层连接性和关联信息。

例如,在递归检索和节点引用的背景下,较小的块(表示为IndexNode对象)可以指向更大的父块。在查询时会检索较小的块,但会跟踪对更大块的引用。 这样可以提供更多合成的背景信息。

LlamaIndex 中的 ServiceContext 是什么?

ServiceContext 是在 LlamaIndex 管道/应用程序的索引和查询阶段中经常使用的资源包。

 ctx_sentence = ServiceContext.from_defaults(llm=llm,embed_model=embed_model,node_parser=nodes)# 以上内容已经包含了SentenceWindowNodeParser#ctx_base = ServiceContext.from_defaults(llm=llm,embed_model=embed_model,node_parser=base_nodes)

LlamaIndex 中的 VectorStoreIndex 是什么?

在 LlamaIndex 中,VectorStoreIndex 是一种索引类型,它使用文本的向量表示以实现有效检索相关上下文。

它构建在 VectorStore 之上,后者是一种存储向量并允许快速最近邻搜索的数据结构。

VectorStoreIndex 接收 IndexNode 对象,这些对象代表了原始文档的块。

它使用一个嵌入模型(在ServiceContext中指定)将这些节点的文本内容转换成向量表示。然后这些向量被存储在VectorStore中。

在查询时,VectorStoreIndex 可以快速检索出针对特定查询最相关的节点。 它通过使用相同的嵌入模型将查询转换为向量,然后在 VectorStore 中执行最近邻搜索来实现这一点。

 sentence_index = VectorStoreIndex(nodes,service_context=ctx_sentence)base_index = VectorStoreIndex(base_nodes,service_context=ctx_base)

LlamaIndex中,RetrieverQueryEngine是什么?

LlamaIndex 中的 RetrieverQueryEngine 是一种查询引擎,它使用一个检索器从索引中获取相关的上下文,给定用户查询。

它主要用于和检索器一起工作,比如从 VectorStoreIndex 创建的 VectorStoreRetriever

RetrieverQueryEngine 接受一个检索器和一个响应合成器作为输入。 检索器负责从索引中获取相关的 IndexNode 对象,而响应合成器则根据检索到的节点和用户查询生成自然语言响应。

LlamaIndex中的 MetadataReplacementPostProcessor是什么?

MetadataReplacementPostProcessor 用于将节点内容替换为节点元数据中的字段。如果元数据中不存在该字段,则节点文本保持不变。与 SentenceWindowNodeParser 结合使用时效果最佳。

 from llama_index.indices.postprocessor import MetadataReplacementPostProcessorsentence_query_engine = sentence_index.as_query_engine(similarity_top_k=5,verbose=True,node_postprocessor=[MetadataReplacementPostProcessor("window")],)​#base_query_engine = base_index.as_query_engine(similarity_top_k=5,verbose=True,node_postprocessor=[MetadataReplacementPostProcessor("window")],)

运行查询以获取句子窗口解析器查询引擎

 query ="使用Python检测图像中的人脸的示例代码。"response = sentence_query_engine.query(query)from IPython.display import display,Markdowndisplay(Markdown(f"<b>{response}</b>"))

生成的响应

这里是一个使用Python和OpenCV库来检测图像中人脸的示例代码:

 import cv2import numpy as np# Load the pre-trained face detection modelface_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')# Load the imageimg = cv2.imread('image.jpg')# Convert the image to grayscalegray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)# Detect faces in the grayscale imagefaces = face_cascade.detectMultiScale(gray, 1.2, 5)# Draw a rectangle around each facefor (x, y, w, h) in faces:cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2)# Display the image with the detected facescv2.imshow('Face Detection', img)cv2.waitKey(0)cv2.destroyAllWindows()

在这段代码中,我们首先使用OpenCV的**CascadeClassifier函数加载预训练的人脸检测模型。然后加载图像,将其转换为灰度,并将其传递给人脸检测模型的detectMultiScale函数以检测人脸。然后使用OpenCV的rectangle函数在每张人脸周围绘制矩形。最后,我们使用OpenCV的imshow**函数显示带有检测到的人脸的图像。

请确保将haarcascade_frontalface_default.xml替换为您预训练的人脸检测模型的路径。

为基节点分析器运行查询查询引擎

 response = base_query_engine.query(query)#display(Markdown(f"<b>{response}</b>"))

回复

 import cv2import numpy as np​img = cv2.imread('image.jpg')gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')faces = face_cascade.detectMultiScale(gray, 1.2, 5)​for (x, y, w, h) in faces:cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2)​cv2.imshow('img', img)cv2.waitKey(0)cv2.destroyAllWindows()

此代码使用Haar级联算法在图像中检测面部。haarcascade_frontalface_default.xml文件包含用于面部检测的训练分类器。detectMultiScale()函数用于以一定比例因子和最小邻域尺寸检测图像中的多个面部。然后,使用rectangle()函数在原始图像上将检测到的面部画成矩形。imshow()函数用于显示图像,而waitKey()函数则用于等待按键后关闭窗口。destroyAllWindows()函数可销毁程序执行期间创建的所有窗口。

保存和重新加载 VectorStore

 from google.colab import drivedrive.mount('/content/drive')

保存至持久存储

 sentence_index.storage_context.persist(persist_dir="location in Gdrive")base_index.storage_context.persist(persist_dir="location in Gdrive")

从存储中检索

 # 重建存储SC_retrieved_sentence = StorageContext.from_defaults(persist_dir="location in Gdrive")SC_retrieved_base = StorageContext.from_defaults(persist_dir="location in Gdrive")

加载索引

 retrieved_sentence_index = load_index_from_storage(SC_retrieved_sentence,service_context=ctx_sentence)retrieved_base_index = load_index_from_storage(SC_retrieved_base,service_context=ctx_base)

重建查询引擎

 from llama_index.postprocessor import MetadataReplacementPostProcessor#sentence_query_engine = retrieved_sentence_index.as_query_engine(similarity_top_k=5,verbose=True,node_postprocessor=[MetadataReplacementPostProcessor("window")],)base_query_engine = retrieved_base_index.as_query_engine(similarity_top_k=5,verbose=True,)

提问问题并得到回应

 base_response = base_query_engine.query(query)#display(Markdown(f"<b>{base_response}</b>"))

相关文章:

如何在LlamaIndex中使用RAG?

如何在LlamaIndex中使用RAG 什么是 Llama-Index LlamaIndex 是一个数据框架&#xff0c;用于帮助基于 LLM 的应用程序摄取、构建结构和访问私有或特定领域的数据。 如何使用 Llama-Index ? 基本用法是一个五步流程&#xff0c;将我们从原始、非结构化数据导向基于该数据生成…...

css气泡背景特效

css气泡背景特效https://www.bootstrapmb.com/item/14879 要创建一个CSS气泡背景特效&#xff0c;你可以使用CSS的伪元素&#xff08;:before 和 :after&#xff09;、border-radius 属性来创建圆形或椭圆形的“气泡”&#xff0c;以及background 和 animation 属性来设置背景…...

7.23模拟赛总结 [数据结构优化dp] + [神奇建图]

目录 复盘题解T2T4 复盘 浅复盘下吧… 7:40 开题 看 T1 &#xff0c;起初以为和以前某道题有点像&#xff0c;子序列划分&#xff0c;注意到状态数很少&#xff0c;搜出来所有状态然后 dp&#xff0c;然后发现这个 T1 和那个毛关系没有 浏览了一下&#xff0c;感觉 T2 题面…...

MySQL-视 图

视 图 创建视图 视图是从一个或者几个基本表&#xff08;或视图&#xff09;导出的表。它与基 本表不同&#xff0c;是一个虚表。 语法&#xff1a; create view 视图名 【view_xxx/v_xxx】 说明&#xff1a; • view_name 自己定义的视图名&#xff1b; • as 后面是这…...

PHP SimpleXML

PHP SimpleXML PHP的SimpleXML扩展提供了一个非常方便的方式来处理XML数据。它是PHP内置的&#xff0c;因此不需要安装额外的库。SimpleXML可以将XML数据转换成对象&#xff0c;使得操作XML变得简单直观。本文将详细介绍SimpleXML的使用方法&#xff0c;包括加载XML、访问和修…...

【Spring Boot 自定义配置项详解】

文章目录 一、配置文件1. properties配置1.1 创建配置文件1.2 添加配置项1.3 在应用中使用配置项1.4 多环境配置 2. YAML配置2.1 创建配置文件2.2 添加配置项2.3 在应用中使用配置项2.4 多环境配置 二、自定义配置类1. 创建配置类2. 使用配置类 一、配置文件 Spring Boot支持多…...

电机相位接线错误导致的潜在问题

交流电机有两种基本类型&#xff1a;单相和三相。一般来说&#xff0c;单相交流电机通常用于家用电器等住宅应用&#xff0c;而三相交流电机则用于工业应用。这主要是因为大多数家庭使用单相电源&#xff0c;而大多数工业场所使用三相电源。 鉴于这两种不同的电源方案&#xf…...

react中如何mock数据

1.需求说明 因为前后端分离开发项目&#xff0c;就会存在前端静态页面写好了&#xff0c;后端数据接口还没写好&#xff1b;这时候前端就需要自己定义数据来使用。 定义数据有三种方式&#xff1a;直接写死数据、使用mock软件、json-server工具 这里讲解通过json-server工具…...

通过Faiss和DINOv2进行场景识别

目标&#xff1a;通过Faiss和DINOv2进行场景识别&#xff0c;确保输入的照片和注册的图片&#xff0c;保持内容一致。 MetaAI 通过开源 DINOv2&#xff0c;在计算机视觉领域取得了一个显着的里程碑&#xff0c;这是一个在包含1.42 亿张图像的令人印象深刻的数据集上训练的模型…...

新手入门基础Java

一:基础语法 1.Java的运行机制 2. Java基本语法 1.注释、标识符、关键字; 2.数据类型(四类八种) 3.类型转换 1.自动转换;2.强制转换; 4.常量和变量 1.常量;2.变量; 3.变量的作用域 5.运算符 1.算数运算符;2.赋值运算符;3.关系运算符; 4.逻辑运算符;5.自…...

2024最新版虚拟便携空调小程序源码 支持流量主切换空调型号

产品截图 部分源代码展示 urls.js Object.defineProperty(exports, "__esModule", {value: !0 }), exports.default ["9c5f1fa582bee88300ffb7e28dce8b68_3188_128_128.png", "E-116154b04e91de689fb1c4ae99266dff_960.svg", "573eee719…...

前端在浏览器总报错,且获取请求头中token的值为null

前端请求总是失败说受跨域请求影响&#xff0c;但前后端配置已经没有问题了&#xff0c;如下&#xff1a; package com.example.shop_manage_sys.config;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Conf…...

html+css前端作业 王者荣耀官网6个页面无js

htmlcss前端作业 王者荣耀官网6个页面无js 下载地址 https://download.csdn.net/download/qq_42431718/89571150 目录1 目录2 项目视频 王者荣耀6个页面&#xff08;无js&#xff09; 页面1 页面2 页面3 页面4 页面5 页面6...

在windows上使用Docker部署一个简易的web程序

使用Docker部署一个python的web服务&#x1f680; 由于是从事算法相关工作&#xff0c;之前在项目中&#xff0c;需要将写完的代码服务&#xff0c;部署在docker上&#xff0c;以此是开始接触了Docker这个工具&#xff0c;由于之前也没系统学习过&#xff0c;之后应该可能还会用…...

sqlalchemy使用mysql的json_extract函数查询JSON字段

sqlalchemy使用mysql的json_extract函数查询JSON字段 在SQLAlchemy中,如果你想要在MySQL中存储JSON字段,并且进行查询操作,可以按照以下步骤进行设置和查询: 1. 创建表格 首先,创建一个表格来存储包含JSON字段的数据。假设我们有一个名为 users 的表格,其中有一个名为…...

分类模型-逻辑回归和Fisher线性判别分析★★★★

该博客为个人学习清风建模的学习笔记&#xff0c;部分课程可以在B站&#xff1a;【强烈推荐】清风&#xff1a;数学建模算法、编程和写作培训的视频课程以及Matlab等软件教学_哔哩哔哩_bilibili 目录 1理论 1.1逻辑回归模型 1.2线性概率模型 1.3线性判别分析 1.4两点分布…...

JMeter介绍、安装配置以及快速入门

文章目录 1. JMeter简介2. JMeter安装配置3. JMeter快速入门 1. JMeter简介 Apache JMeter是一款开源的压力测试工具&#xff0c;主要用于测试静态和动态资源&#xff08;如静态文件、服务器、数据库、FTP服务器等&#xff09;的性能。它最初是为测试Web应用而设计的&#xff…...

GPT LangChain experimental agent - allow dangerous code

题意&#xff1a;GPT LangChain 实验性代理 - 允许危险代码 问题背景&#xff1a; Im creating a chatbot in VS Code where it will receive csv file through a prompt on Streamlit interface. However from the moment that file is loaded, it is showing a message with…...

1 LableMe安装下载

git:GitHub - labelmeai/labelme: Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation). 1 LabelMe介绍 LabelMe是一个图像标注工具&#xff0c;主要用于帮助研究人员和开发者创建有标签的数据集&#xff0c;这…...

rce漏洞-ctfshow(50-70)

Web51 if(!preg_match("/\;|cat|flag| |[0-9]|\\$|\*|more|less|head|sort|tail|sed|cut|tac|awk|strings|od|curl|\|\%|\x09|\x26/i", $c)){ system($c." >/dev/null 2>&1"); } Nl&#xff0c;绕过tac&#xff0c;cat&#xff0c;绕…...

vulntarget-a靶机-复现报告

靶机复现过程 测试标题 测试过程 测试外网ip 192.168.2.84 测试详情 第一步&#xff0c;我们先对其这个外网ip进行扫描&#xff0c;结果如下 结果我们发现这个ip开启了80和445端口&#xff0c;同时我们还可以看到这里是win7系统&#xff0c;我们先看看web页面是怎样的 结…...

为什么 FPGA 的效率低于 ASIC?

FPGA是“可重构逻辑”器件。先制造的芯片&#xff0c;再次设计时“重新配置”。 ASIC 不需要“重新配置”。你先设计&#xff0c;把它交给代工厂&#xff0c;然后制造芯片。 现在让我们看看这些芯片的结构是什么样的&#xff0c;以及它们的不同之处。 ● 逻辑单元&#xff1a;F…...

使用水星Mecury人形机器人搭建VR遥操作控制平台!

VR遥操作机械臂是一种将虚拟现实技术与机械臂控制相结合的系统&#xff0c;使用户可以通过虚拟现实设备操控和交互实际的机械臂。这种技术可以应用于多个领域&#xff0c;包括远程操作、培训、危险环境中的工作等。 双臂人形机器人是一种模拟人体上半身结构&#xff0c;包括头部…...

【学习笔记】无人机系统(UAS)的连接、识别和跟踪(三)-架构模型和概念

引言 3GPP TS 23.256 技术规范&#xff0c;主要定义了3GPP系统对无人机&#xff08;UAV&#xff09;的连接性、身份识别、跟踪及A2X&#xff08;Aircraft-to-Everything&#xff09;服务的支持。 3GPP TS 23.256 技术规范&#xff1a; 【免费】3GPPTS23.256技术报告-无人机系…...

uniapp bug解决:uniapp文件查找失败:‘uview-ui‘ at main.js:14

文章目录 报错内容解决方法main.js 文件中 uView 主 JS 库引入 uView 的全局 SCSS 主题文件内容修改引入 uView 基础样式内容修改配置 easycom 内容修改 报错内容 10:50:51.795 文件查找失败&#xff1a;uview-ui at main.js:14 10:59:39.570 正在差量编译... 10:59:43.213 文…...

Python 爬虫(爬取百度翻译的数据)

前言 要保证爬虫的合法性&#xff0c;可以从以下几个方面着手&#xff1a; 遵守网站的使用条款和服务协议&#xff1a;在爬取数据之前&#xff0c;仔细阅读目标网站的相关规定。许多网站会在其 robots.txt 文件中明确说明哪些部分可以爬取&#xff0c;哪些不可以。 例如&…...

【LeetCode:2766. 重新放置石块 + 哈希表】

&#x1f680; 算法题 &#x1f680; &#x1f332; 算法刷题专栏 | 面试必备算法 | 面试高频算法 &#x1f340; &#x1f332; 越难的东西,越要努力坚持&#xff0c;因为它具有很高的价值&#xff0c;算法就是这样✨ &#x1f332; 作者简介&#xff1a;硕风和炜&#xff0c;…...

[C++]类的自动转换和强制类型转换

在C中&#xff0c;类的自动转换&#xff08;也称为隐式转换&#xff09;和强制类型转换&#xff08;显式转换&#xff09;是面向对象编程中处理类型之间转换的两种重要机制。这些转换允许程序员定义如何在不同类型&#xff08;特别是自定义类型&#xff09;之间安全地交换数据。…...

根据鼠标所在位置获取组件拿到 “qt_scrollarea_viewport” 组件的问题

问题起因&#xff1a; 有时候需要鼠标实时所在位置的组件&#xff0c;可以通过如下方法实时获取: QWidget *current_widget QApplication::widgetAt(QCursor().pos()); qDebug() << __FUNCTION__ << current_widget;// 如果是按钮&#xff0c;直接进行转换 QPus…...

深入浅出WebRTC—LossBasedBweV2

WebRTC 同时使用基于丢包的带宽估计算法和基于延迟的带宽估计算法那&#xff0c;能够实现更加全面和准确的带宽评估和控制。基于丢包的带宽估计算法主要依据网络中的丢包情况来动态调整带宽估计&#xff0c;以适应网络状况的变化。本文主要讲解最新 LossBasedBweV2 的实现。 1…...