网站网页设计前言/高效统筹疫情防控和经济社会发展

网站网页设计前言,高效统筹疫情防控和经济社会发展,网站模板怎么建站,学软件开发需要多少钱嘿,亲爱的算法工程师们!今天咱们聊一聊PDF解析的那些事儿,简直就像是在玩一场“信息捉迷藏”游戏!PDF文档就像是个调皮的小精灵,表面上看起来规规矩矩,但当你想要从它那里提取信息时,它就开始跟…

嘿,亲爱的算法工程师们!今天咱们聊一聊PDF解析的那些事儿,简直就像是在玩一场“信息捉迷藏”游戏!PDF文档就像是个调皮的小精灵,表面上看起来规规矩矩,但当你想要从它那里提取信息时,它就开始跟你玩捉迷藏了。
在RAG(Retrieval-Augmented Generation)中,从文档中提取信息是一个不可避免的场景。确保从源内容中有效提取信息对于提高最终输出的质量至关重要。

不要低估这个过程。在实现RAG时,解析过程中信息提取不当会导致对PDF文件中包含信息的理解和利用受限。

下图显示了PDF解析过程(红框)在RAG中的位置。:在这里插入图片描述
在实际工作中,非结构化数据比结构化数据丰富得多。如果这些海量数据无法解析,它们的巨大价值将无法实现。

在非结构化数据中,PDF文档占据了大多数。 有效处理PDF文档也可以极大地帮助管理其他类型的非结构化文档。

预防针

1. PDF解析的“魔法”

  • 规则派:用规则去解析PDF,就像是用一把钥匙去开锁,虽然简单直接,但遇到复杂的PDF布局时,这把钥匙可能就“卡壳”了。
  • 深度学习派:深度学习模型就像是“魔法师”,能准确识别文档的布局,甚至能理解表格里的复杂结构。不过,这“魔法”需要强大的GPU加持,不然可能会慢得像蜗牛爬。
  • 多模态大模型派:这是最新的“黑科技”,结合了图像识别和文本处理,能像“超级侦探”一样从PDF中提取出最复杂的信息。

2. PDF解析的“陷阱”

  • 双栏PDF的“迷宫”:双栏PDF就像是个迷宫,解析时一不小心就会把左右栏的内容搞混。不过,咱们可以通过“中心线”算法来破解这个迷宫,确保信息按正确的顺序排列。
  • 多级标题的“捉迷藏”:PDF里的多级标题就像是在玩捉迷藏,你得通过布局块的高度差来找到它们。找到这些标题后,LLM的回答就会更加准确,就像给AI装上了“导航仪”。

3. 未来的“魔法棒”

  • 多模态模型:未来的PDF解析可能会越来越依赖多模态模型,尤其是结合了图像识别和文本处理的模型。它们不仅能解析表格,还能从图像中提取关键信息,简直是“全能选手”。

提前的忠告

PDF解析就像是一场“信息大冒险”,没有一种方法是万能的。你得根据具体的PDF类型和项目需求,选择合适的“魔法工具”。不过,如果你有条件,深度学习或多模态模型绝对是你的“最佳拍档”。

好了,下面我们进行详细的剖析

解析PDF文件的方法

解析PDF的难点

PDF文档是非结构化文档的代表,然而,从PDF文档中提取信息是一个具有挑战性的过程。

与其说PDF是一种数据格式,不如说它是一组打印指令。 PDF文件由一系列指令组成,这些指令告诉PDF阅读器或打印机在屏幕或纸张上显示符号的位置和方式。这与HTML和docx等文件格式形成对比,后者使用诸如<p><w:p><table><w:tbl>等标签来组织不同的逻辑结构,如图2所示:图2:HTML vs PDF。

解析PDF文档的挑战在于准确提取整个页面的布局,并将内容(包括表格、标题、段落和图像)转换为文档的文本表示。 这个过程涉及处理文本提取的不准确性、图像识别以及表格中行列关系的混淆。

解析PDF文档的“魔法”

一般来说,解析PDF有三种方法:

  • 基于规则的方法:根据文档的组织特征确定每个部分的样式和内容。然而,这种方法并不具有很好的通用性,因为PDF的类型和布局多种多样,无法用预定义的规则覆盖所有情况。
  • 基于深度学习模型的方法:例如结合目标检测和OCR模型的流行解决方案。
  • 基于多模态大模型的复杂结构解析或关键信息提取

基于规则的方法

最具代表性的工具之一是pypdf,它是一个广泛使用的基于规则的解析器。它是LangChain和LlamaIndex中解析PDF文件的标准方法。

以下是使用pypdf解析"Attention Is All You Need"论文第6页的尝试。原始页面如图3所示。

![外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传](https://img-home.csdnimg.cn/images/20230724024159.png?origin_url=https%3A%2F%2Farxiv.org%2Fpdf%2F1706.03762.pdf&pos_id=img-ErnKMfZS-1742654400641

代码如下:

import PyPDF2
filename = "/Users/Florian/Downloads/1706.03762.pdf"
pdf_file = open(filename, 'rb')reader = PyPDF2.PdfReader(pdf_file)page_num = 5
page = reader.pages[page_num]
text = page.extract_text()print('--------------------------------------------------')
print(text)pdf_file.close()

执行结果如下(省略部分内容):

pip list | grep pypdf
pypdf                    3.17.4
pypdfium2                4.26.0python /Users/Florian/Downloads/pypdf_test.py
--------------------------------------------------
Table 1: Maximum path lengths, per-layer complexity and minimum number of sequential operations
for different layer types. nis the sequence length, dis the representation dimension, kis the kernel
size of convolutions and rthe size of the neighborhood in restricted self-attention.
Layer Type Complexity per Layer Sequential Maximum Path Length
Operations
Self-Attention O(n2·d) O(1) O(1)
Recurrent O(n·d2) O(n) O(n)
Convolutional O(k·n·d2) O(1) O(logk(n))
Self-Attention (restricted) O(r·n·d) O(1) O(n/r)
3.5 Positional Encoding
Since our model contains no recurrence and no convolution, in order for the model to make use of the
order of the sequence, we must inject some information about the relative or absolute position of the
tokens in the sequence. To this end, we add "positional encodings" to the input embeddings at the
bottoms of the encoder and decoder stacks. The positional encodings have the same dimension dmodel
as the embeddings, so that the two can be summed. There are many choices of positional encodings,
learned and fixed [9].
In this work, we use sine and cosine functions of different frequencies:
PE(pos,2i)=sin(pos/100002i/d model)
PE(pos,2i+1)=cos(pos/100002i/d model)
where posis the position and iis the dimension. That is, each dimension of the positional encoding
corresponds to a sinusoid. The wavelengths form a geometric progression from 2πto10000 ·2π. We
chose this function because we hypothesized it would allow the model to easily learn to attend by
relative positions, since for any fixed offset k,PEpos+kcan be represented as a linear function of
PEpos.
...
...
...

根据PyPDF的检测结果,观察到它将PDF中的字符序列序列化为一个长序列,而没有保留结构信息。换句话说,它将文档的每一行视为由换行符“\n”分隔的序列,这阻碍了准确识别段落或表格。

这种限制是基于规则方法的固有特性。

基于深度学习模型的方法

这种方法的优点是能够准确识别整个文档的布局,包括表格和段落。它甚至可以理解表格内部的结构。这意味着它可以将文档划分为定义明确、完整的信息单元,同时保留预期的含义和结构。

然而,这种方法也有一些局限性。目标检测和OCR阶段可能耗时较长。因此,建议使用GPU或其他加速设备,并采用多进程和多线程进行处理。

这种方法涉及目标检测和OCR模型,我测试了几个具有代表性的开源框架:

  • Unstructured:它已经集成到langchain中。使用hi_res策略和infer_table_structure=True的表格识别效果很好。然而,fast策略表现不佳,因为它没有使用目标检测模型,错误地识别了许多图像和表格。
  • Layout-parser:如果需要识别复杂的结构化PDF,建议使用最大的模型以获得更高的准确性,尽管速度可能稍慢。此外,Layout-parser的模型在过去两年似乎没有更新。
  • PP-StructureV2:使用各种模型组合进行文档分析,性能高于平均水平。架构如下图所示:
    在这里插入图片描述

除了开源工具外,还有像ChatDOC这样的付费工具,它们利用基于布局的识别+OCR方法来解析PDF文档。

接下来,我们将解释如何使用开源的unstructured框架解析PDF,解决三个关键挑战。

挑战1:如何从表格和图像中提取数据

这里,我们将使用unstructured框架作为示例。检测到的表格数据可以直接导出为HTML。代码如下:

from unstructured.partition.pdf import partition_pdffilename = "/Users/Florian/Downloads/Attention_Is_All_You_Need.pdf"# infer_table_structure=True 自动选择 hi_res 策略
elements = partition_pdf(filename=filename, infer_table_structure=True)
tables = [el for el in elements if el.category == "Table"]print(tables[0].text)
print('--------------------------------------------------')
print(tables[0].metadata.text_as_html)

**partition_pdf**函数的内部过程:下图是一个基本的流程图。

在这里插入图片描述

图5:**partition_pdf**函数的内部流程。作者提供的图片。

代码的运行结果如下:

Layer Type Self-Attention Recurrent Convolutional Self-Attention (restricted) Complexity per Layer O(n2 · d) O(n · d2) O(k · n · d2) O(r · n · d) Sequential Maximum Path Length Operations O(1) O(n) O(1) O(1) O(1) O(n) O(logk(n)) O(n/r)
--------------------------------------------------
<table><thead><th>Layer Type</th><th>Complexity per Layer</th><th>Sequential Operations</th><th>Maximum Path Length</th></thead><tr><td>Self-Attention</td><td>O(n? - d)</td><td>O(1)</td><td>O(1)</td></tr><tr><td>Recurrent</td><td>O(n- d?)</td><td>O(n)</td><td>O(n)</td></tr><tr><td>Convolutional</td><td>O(k-n-d?)</td><td>O(1)</td><td>O(logy(n))</td></tr><tr><td>Self-Attention (restricted)</td><td>O(r-n-d)</td><td>ol)</td><td>O(n/r)</td></tr></table>

将HTML标签复制并保存为HTML文件。然后,使用Chrome打开,如下所示:

None

可以观察到,unstructured的算法在很大程度上还原了整个表格。

挑战2:如何重新排列检测到的块?特别是对于双栏PDF。

在处理双栏PDF时,我们以论文"BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding"为例。阅读顺序如下图中的红色箭头所示:在这里插入图片描述
图7:双栏页面。

在识别布局后,unstructured框架将把每一页划分为几个矩形块,如下图所示:双栏。
在这里插入图片描述

每个矩形块的详细信息可以以以下格式获取:

[LayoutElement(bbox=Rectangle(x1=851.1539916992188, y1=181.15073777777613, x2=1467.844970703125, y2=587.8204599999975), text='These approaches have been generalized to coarser granularities, such as sentence embed- dings (Kiros et al., 2015; Logeswaran and Lee, 2018) or paragraph embeddings (Le and Mikolov, 2014). To train sentence representations, prior work has used objectives to rank candidate next sentences (Jernite et al., 2017; Logeswaran and Lee, 2018), left-to-right generation of next sen- tence words given a representation of the previous sentence (Kiros et al., 2015), or denoising auto- encoder derived objectives (Hill et al., 2016). ', source=<Source.YOLOX: 'yolox'>, type='Text', prob=0.9519357085227966, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=196.5296173095703, y1=181.1507377777777, x2=815.468994140625, y2=512.548237777777), text='word based only on its context. Unlike left-to- right language model pre-training, the MLM ob- jective enables the representation to fuse the left and the right context, which allows us to pre- In addi- train a deep bidirectional Transformer. tion to the masked language model, we also use a "next sentence prediction" task that jointly pre- trains text-pair representations. The contributions of our paper are as follows: ', source=<Source.YOLOX: 'yolox'>, type='Text', prob=0.9517233967781067, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=200.22352600097656, y1=539.1451822222216, x2=825.0242919921875, y2=870.542682222221), text='• We demonstrate the importance of bidirectional pre-training for language representations. Un- like Radford et al. (2018), which uses unidirec- tional language models for pre-training, BERT uses masked language models to enable pre- trained deep bidirectional representations. This is also in contrast to Peters et al. (2018a), which uses a shallow concatenation of independently trained left-to-right and right-to-left LMs. ', source=<Source.YOLOX: 'yolox'>, type='List-item', prob=0.9414362907409668, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=851.8727416992188, y1=599.8257377777753, x2=1468.0499267578125, y2=1420.4982377777742), text='ELMo and its predecessor (Peters et al., 2017, 2018a) generalize traditional word embedding re- search along a different dimension. They extract context-sensitive features from a left-to-right and a right-to-left language model. The contextual rep- resentation of each token is the concatenation of the left-to-right and right-to-left representations. When integrating contextual word embeddings with existing task-specific architectures, ELMo advances the state of the art for several major NLP benchmarks (Peters et al., 2018a) including ques- tion answering (Rajpurkar et al., 2016), sentiment analysis (Socher et al., 2013), and named entity recognition (Tjong Kim Sang and De Meulder, 2003). Melamud et al. (2016) proposed learning contextual representations through a task to pre- dict a single word from both left and right context using LSTMs. Similar to ELMo, their model is feature-based and not deeply bidirectional. Fedus et al. (2018) shows that the cloze task can be used to improve the robustness of text generation mod- els. ', source=<Source.YOLOX: 'yolox'>, type='Text', prob=0.938507616519928, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=199.3734130859375, y1=900.5257377777765, x2=824.69873046875, y2=1156.648237777776), text='• We show that pre-trained representations reduce the need for many heavily-engineered task- specific architectures. BERT is the first fine- tuning based representation model that achieves state-of-the-art performance on a large suite of sentence-level and token-level tasks, outper- forming many task-specific architectures. ', source=<Source.YOLOX: 'yolox'>, type='List-item', prob=0.9461237788200378, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=195.5695343017578, y1=1185.526123046875, x2=815.9393920898438, y2=1330.3272705078125), text='• BERT advances the state of the art for eleven NLP tasks. The code and pre-trained mod- els are available at https://github.com/ google-research/bert. ', source=<Source.YOLOX: 'yolox'>, type='List-item', prob=0.9213815927505493, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=195.33956909179688, y1=1360.7886962890625, x2=447.47264000000007, y2=1397.038330078125), text='2 Related Work ', source=<Source.YOLOX: 'yolox'>, type='Section-header', prob=0.8663332462310791, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=197.7477264404297, y1=1419.3353271484375, x2=817.3308715820312, y2=1527.54443359375), text='There is a long history of pre-training general lan- guage representations, and we briefly review the most widely-used approaches in this section. ', source=<Source.YOLOX: 'yolox'>, type='Text', prob=0.928022563457489, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=851.0028686523438, y1=1468.341394166663, x2=1420.4693603515625, y2=1498.6444497222187), text='2.2 Unsupervised Fine-tuning Approaches ', source=<Source.YOLOX: 'yolox'>, type='Section-header', prob=0.8346447348594666, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=853.5444444444446, y1=1526.3701822222185, x2=1470.989990234375, y2=1669.5843488888852), text='As with the feature-based approaches, the first works in this direction only pre-trained word em- (Col- bedding parameters from unlabeled text lobert and Weston, 2008). ', source=<Source.YOLOX: 'yolox'>, type='Text', prob=0.9344717860221863, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=200.00000000000009, y1=1556.2037353515625, x2=799.1743774414062, y2=1588.031982421875), text='2.1 Unsupervised Feature-based Approaches ', source=<Source.YOLOX: 'yolox'>, type='Section-header', prob=0.8317819237709045, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=198.64227294921875, y1=1606.3146266666645, x2=815.2886352539062, y2=2125.895459999998), text='Learning widely applicable representations of words has been an active area of research for decades, including non-neural (Brown et al., 1992; Ando and Zhang, 2005; Blitzer et al., 2006) and neural (Mikolov et al., 2013; Pennington et al., 2014) methods. Pre-trained word embeddings are an integral part of modern NLP systems, of- fering significant improvements over embeddings learned from scratch (Turian et al., 2010). To pre- train word embedding vectors, left-to-right lan- guage modeling objectives have been used (Mnih and Hinton, 2009), as well as objectives to dis- criminate correct from incorrect words in left and right context (Mikolov et al., 2013). ', source=<Source.YOLOX: 'yolox'>, type='Text', prob=0.9450697302818298, image_path=None, parent=None), LayoutElement(bbox=Rectangle(x1=853.4905395507812, y1=1681.5868488888855, x2=1467.8729248046875, y2=2125.8954599999965), text='More recently, sentence or document encoders which produce contextual token representations have been pre-trained from unlabeled text and fine-tuned for a supervised downstream task (Dai and Le, 2015; Howard and Ruder, 2018; Radford et al., 2018). The advantage of these approaches is that few parameters need to be learned from scratch. At least partly due to this advantage, OpenAI GPT (Radford et al., 2018) achieved pre- viously state-of-the-art results on many sentence- level tasks from the GLUE benchmark (Wang language model- Left-to-right et al., 2018a). ', source=<Source.YOLOX: 'yolox'>, type='Text', prob=0.9476840496063232, image_path=None, parent=None)]

其中(x1, y1)是左上顶点的坐标,(x2, y2)是右下顶点的坐标:

        (x_1, y_1) --------|             ||             ||             |---------- (x_2, y_2)

此时,您可以选择重新排列页面的阅读顺序。Unstructured自带一个排序算法,但我发现它在处理双栏情况时排序结果并不理想。

因此,有必要设计一个算法。最简单的方法是首先按左上顶点的水平坐标排序,如果水平坐标相同,则按垂直坐标排序。伪代码如下:

layout.sort(key=lambda z: (z.bbox.x1, z.bbox.y1, z.bbox.x2, z.bbox.y2))

然而,我们发现即使在同一列中的块,其水平坐标也可能有变化。如图9所示,紫色线块的水平坐标bbox.x1实际上更靠左。排序时,它将位于绿色线块之前,这显然违反了阅读顺序(同一列中的块可能具有不同的水平坐标)
在这里插入图片描述

在这种情况下,可以使用以下算法:

  • 首先,对所有左上顶点的x坐标**x1进行排序,得到x1_min**
  • 然后,对所有右下顶点的x坐标**x2进行排序,得到x2_max**
  • 接下来,确定页面中心线的x坐标为:
x1_min = min([el.bbox.x1 for el in layout])
x2_max = max([el.bbox.x2 for el in layout])
mid_line_x_coordinate = (x2_max + x1_min) /  2

接下来,if bbox.x1 < mid_line_x_coordinate,将块分类为左栏。否则,将其视为右栏。

分类完成后,根据每个块的y坐标对每栏中的块进行排序。最后,将右栏连接到左栏的右侧。

left_column = []
right_column = []
for el in layout:if el.bbox.x1 < mid_line_x_coordinate:left_column.append(el)else:right_column.append(el)left_column.sort(key = lambda z: z.bbox.y1)
right_column.sort(key = lambda z: z.bbox.y1)
sorted_layout = left_column + right_column

值得一提的是,这种改进也适用于单栏PDF。

挑战3:如何提取多级标题

提取标题(包括多级标题)的目的是提高LLM回答的准确性。

例如,如果用户想知道图9中2.1节的主要思想,通过准确提取2.1节的标题,并将其与相关内容一起作为上下文发送给LLM,最终答案的准确性将显著提高。

该算法仍然依赖于图9中展示的布局块。我们可以提取**type='Section-header'的块,并计算高度差(bbox.y2 — bbox.y1**)。高度差最大的块对应一级标题,其次是二级标题,然后是三级标题。

基于多模态大模型的PDF复杂结构解析

在多模态模型爆发后,也可以使用多模态模型来解析表格。有几种选择:

  • 检索相关图像(PDF页面)并将其发送给GPT4-V以响应查询。
  • 将每个PDF页面视为图像,让GPT4-V对每个页面进行图像推理。为图像推理构建文本向量存储索引。查询答案时,针对图像推理向量存储进行查询。
  • 使用Table Transformer从检索到的图像中裁剪表格信息,然后将这些裁剪后的图像发送给GPT4-V以响应查询。
  • 对裁剪后的表格图像应用OCR,并将数据发送给GPT4/GPT-3.5以回答查询。

经过测试,确定第三种方法最有效。

此外,我们可以使用多模态模型从图像中提取或总结关键信息(PDF文件可以轻松转换为图像),如下图所示。
在这里插入图片描述

从图像中提取或总结关键信息。来源:GPT-4 with Vision: Complete Guide and
Evaluation。

结论

总的来说,非结构化文档具有高度的灵活性,需要各种解析技术。然而,目前还没有关于使用哪种方法最佳的共识。

在这种情况下,建议选择最适合项目需求的方法。建议根据不同类型的PDF应用特定的处理方法。例如,论文、书籍和财务报表可能根据其特点具有独特的设计。

尽管如此,如果条件允许,仍然建议选择基于深度学习或多模态的方法。这些方法可以有效地将文档划分为定义明确且完整的信息单元,从而最大限度地保留文档的预期含义和结构。

好了,今天的“PDF解析大冒险”就到这里!如果你还有什么问题,欢迎在评论区留言,咱们一起探讨!记住,搞砸了的话,你的工作可能会像气球一样飞走哦!😉

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/73077.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Python网络编程入门

一.Socket 简称套接字&#xff0c;是进程之间通信的一个工具&#xff0c;好比现实生活中的插座&#xff0c;所有的家用电器要想工作都是基于插座进行&#xff0c;进程之间要想进行网络通信需要Socket&#xff0c;Socket好比数据的搬运工~ 2个进程之间通过Socket进行相互通讯&a…

mac calDAV 日历交互

安装Bakal docker https://sabre.io/dav/building-a-caldav-client/ 在Bakal服务器上注册账户 http://localhost:8080/admin/?/users/calendars/user/1/ 在日历端登录账户&#xff1a; Server: http://127.0.0.1:8080/dav.php Server Path: /dav.php/principals/lion No e…

Python设计模式 - 适配器模式

定义 适配器模式&#xff08;Adapter Pattern&#xff09;是一种结构型设计模式&#xff0c;它用于将一个类的接口转换为客户端所期待的另一个接口。 注&#xff1a;在适配器模式定义中所提及的接口是指广义的接口&#xff0c;它可以表示一个方法或者一组方法的集合。 结构 …

【前端工程化】

目录 前端工程户核心技术之模块化前端模块化的进化过程commonjs规范介绍commonjs规范示例commonjs模块打包 amd规范、cmd规范前端工程化关键技术之npmwebpack原理 前端工程户核心技术之模块化 前端模块化是一种标准&#xff0c;不是实现。commonjs是前端模块化的标准&#xff…

T113-i开发板的休眠与RTC定时唤醒指南

​​在嵌入式系统设计中&#xff0c;休眠与唤醒技术是优化电源管理、延长设备续航的关键。飞凌嵌入式基于全志T113-i处理器开发设计的OK113i-S开发板提供了两种休眠模式&#xff1a;freeze和mem&#xff0c;以满足不同应用场景下的功耗与恢复速度需求。本文将详细介绍如何让OK1…

SpringBoot项目实战(初级)

目录 一、数据库搭建 二、代码开发 1.pom.xml 2.thymeleaf模块处理的配置类 3.application配置文件 4.配置&#xff08;在启动类中&#xff09; 5.编写数据层 ②编写dao层 ③编写service层 接口 实现类 注意 补充&#xff08;注入的3个注解&#xff09; 1.AutoWir…

某视频的解密下载

下面讲一下怎么爬取视频&#xff0c;这个还是比小白的稍微有一点绕的 首先打开网址&#xff1a;aHR0cDovL3d3dy5wZWFydmlkZW8uY29tL3BvcHVsYXJfNA 首页 看一下&#xff1a; 有一个标题和一个href&#xff0c;href只是一个片段&#xff0c;待会肯定要拼接&#xff0c; 先找一…

C++继承机制:从基础到避坑详细解说

目录 1.继承的概念及定义 1.1继承的概念 1.2 继承定义 1.2.1定义格式 1.2.2继承关系和访问限定符 1.2.3继承基类成员访问方式的变化 总结&#xff1a; 2.基类和派生类对象赋值转换 3.继承中的作用域 4.派生类的默认成员函数 ​编辑 默认构造与传参构造 拷贝构造&am…

测试基础入门

文章目录 软件测试基础1.1软件测试概述什么是软件测试什么是软件需求说明书软件测试的原则测试用例的设计测试用例设计的基本原则软件测试分类软件缺陷的定义 2.1软件开发模型软件开发模型概述大爆炸模型&#xff08;边写边改&#xff09;软件开发生命周期模型--螺旋模型软件开…

022-spdlog

spdlog 以下是从原理到代码实现的全方位spdlog技术调研结果&#xff0c;结合核心架构、优化策略和完整代码示例&#xff1a; 一、核心架构设计原理 spdlog三级架构 &#xff08;图示说明&#xff1a;spdlog采用三级结构实现日志系统解耦&#xff09; Registry管理中枢 全局…

STM32时钟树

时钟树 时钟树就是STM32中用来产生和配置时钟&#xff0c;并且把配置好的时钟发送到各个外设的系统&#xff0c;时钟是所有外设运行的基础&#xff0c;所以时钟也是最先需要配置的东西&#xff0c;在程序中主函数之前还会执行一个SystemClock_Config()函数&#xff0c;这个函数…

【第22节】windows网络编程模型(WSAAsyncSelect模型)

目录 引言 一、WSAAsyncSelect模型概述 二、WSAAsyncSelect模型流程 2.1 自定义消息 2.2 创建窗口例程 2.3 初始化套接字 2.4 注册网络事件 2.5 绑定和监听 2.6 消息循环 三、完整示例代码 引言 在网络编程的广袤天地中&#xff0c;高效处理网络事件是构建稳定应用的…

利用Dify编制用户问题意图识别和规范化回复

继上一篇文章&#xff0c;成功完成Dify本地部署后&#xff0c;主要做了一些workflow和Agent的应用实现&#xff0c;整体感觉dify在工作流可视化编排方面非常好&#xff0c;即使部分功能无法实现&#xff0c;也可以通过代码执行模块或者自定义工具来实现&#xff08;后续再具体分…

OpenGL ES ->乒乓缓冲,计算只用两个帧缓冲对象(Frame Buffer Object)+叠加多个滤镜作用后的Bitmap

乒乓缓冲核心思想 不使用乒乓缓冲&#xff0c;如果要每个滤镜作用下的绘制内容&#xff0c;也就是这个滤镜作用下的帧缓冲&#xff0c;需要创建一个Frame Buffer Object加上对应的Frame Buffer Object Texture使用乒乓缓冲&#xff0c;只用两个Frame Buffer Object加上对应的F…

ccfcsp1901线性分类器

//线性分类器 #include<iostream> using namespace std; int main(){int n,m;cin>>n>>m;int x[1000],y[1000];char z[1000];for(int i0;i<n;i){cin>>x[i]>>y[i];cin>>z[i];}int a[20],b[20],c[20];for(int i0;i<m;i){cin>>a[i…

APM 仿真遥控指南

地面站开发了一段时间了&#xff0c;由于没有硬件&#xff0c;所以一直在 APM 模拟器中验证。我们已经实现了 MAVLink 消息接收和解析&#xff0c;显示无人机状态&#xff0c;给无人机发送消息&#xff0c;实现一键起飞&#xff0c;飞往指定地点&#xff0c;降落&#xff0c;返…

《信息系统安全》(第一次上机实验报告)

实验一 &#xff1a;网络协议分析工具Wireshark 一 实验目的 学习使用网络协议分析工具Wireshark的方法&#xff0c;并用它来分析一些协议。 二实验原理 TCP/IP协议族中网络层、传输层、应用层相关重要协议原理。网络协议分析工具Wireshark的工作原理和基本使用规则。 三 实…

城市街拍人像自拍电影风格Lr调色教程,手机滤镜PS+Lightroom预设下载!

调色教程 城市街拍人像自拍的电影风格 Lr 调色&#xff0c;是利用 Adobe Lightroom 软件&#xff0c;对在城市街景中拍摄的人像自拍照片进行后期处理&#xff0c;使其呈现出电影画面般独特的视觉质感与艺术氛围。通过一系列调色操作&#xff0c;改变照片的色彩、明暗、对比等元…

Qt/C++项目积累:4.远程升级工具 - 4.1 项目设想

背景&#xff1a; 桌面程序一般都支持远程升级&#xff0c;也是比较常用的场景设计。如酷狗音乐的升级&#xff0c;会提供两个选项&#xff0c;自动帮助安装或是新版本提醒&#xff0c;由用户来决定是否升级&#xff0c;都属于远程升级的应用及策略。 看看经过这块的功能了解及…