赞
踩
实现RAG是一个挑战,尤其是在有效解析和理解非结构化文档中的表格时,对于扫描的文档或图像格式的文档来说尤其困难。这些挑战至少有三个方面:
本文将介绍RAG中管理表格数据的关键技术,然后回顾一些现有的开源解决方案,最后实现一个解决方案。
该模块的主要功能是从非结构化文档或图像中准确提取表结构。最好可以提取出相应的表标题,这样方便开发人员将表标题与表关联起来。
根据我目前的理解,有几种方法,如图1所示:
(a)利用多模态LLM(如GPT-4V[1])来识别表格并从每个PDF页面中提取信息
输入:图像格式的PDF页面
输出:JSON或其他格式的表。如果多模态LLM无法提取表格数据,则应总结图像并返回摘要。
(b)利用专业的表格检测模型(如Table Transformer[2]),来辨别表格结构
输入:PDF页面作为图像
输出:表格作为图像
(c)使用开源框架(如unstructured[3]或者目标检测模型[4]。这些框架可以对整个文档进行全面的解析,并从解析的结果中提取与表相关的内容
输入:PDF或图像格式的文档
输出:纯文本或HTML格式的表,从整个文档的解析结果中获得
(d)使用Nougat[5]、Donut[6]等端到端模型来解析整个文档并提取与表相关的内容。这种方法不需要OCR模型
输入:PDF或图像格式的文档
输出:LaTeX或JSON格式的表,从整个文档的解析结果中获得
值得一提的是,无论使用何种方法提取表格信息,都应包括表格标题。这是因为在大多数情况下,表格标题是文档或论文作者对表格的简短描述,可以在很大程度上概括整个表格。
在上述四种方法中,方法(d)允许容易地检索表标题,这将在下面的实验中进一步解释。
根据索引的结构,大致可以分为以下几类:
(e)仅使用图像格式的索引表;
(f)仅使用纯文本或JSON格式的索引表;
(g)仅使用LaTeX格式的索引表;
(h)仅为表的摘要编制索引;
(i)“从小到大”或“文档摘要索引”结构,如图2所示:
如上所述,表格摘要通常使用LLM生成:
输入:图像格式、文本格式或LaTeX格式的表格
输出:表格摘要
下面介绍一些不需要表解析的算法:
(j)将相关图像(PDF页面)和用户查询发送到VQA模型(如DAN等)或多模态LLM,并返回答案;
要索引的内容:图像格式的文档
发送到VQA模型或多模态LLM的内容:查询+图像形式的相应页面
(k)将相关文本格式的PDF页面和用户的查询发送到LLM,然后返回答案;
要索引的内容:文本格式的文档
发送到LLM的内容:查询+文本格式的相应页面
(l)将相关图像(PDF页面)、文本块和用户的查询发送到多模态LLM(如GPT-4V等),并直接返回答案;
要索引的内容:图像格式的文档和文本格式的文档块
发送到多模态LLM的内容:查询+文档的相应图像形式+相应的文本块
以下是一些不需要索引的方法,如图3和图4所示:
(m)首先,应用类别(a)到(d)中的一种方法,将文档中的所有表格解析为图像形式,然后直接将所有表格图像和用户的查询发送到多模态LLM(如GPT-4V等)并返回答案。
要索引的内容:无
发送到多模态LLM的内容:查询+所有解析的表(图像格式)
(n)使用(m)提取的图像格式的表格,然后使用OCR模型识别表格中的所有文本,然后直接将表格中的全部文本和用户的查询发送到LLM并直接返回答案。
要索引的内容:无
发送到LLM的内容:用户查询+所有表内容(文本格式)
值得注意的是,有些方法不依赖于RAG过程:
第一种方法不使用LLM,在特定的数据集上进行训练,并使模型(如类似BERT的transformer)能够更好地支持表理解任务,如TAPAS[7]。
第二种方法使用LLM,采用预训练、微调方法或提示,使LLM能够执行表理解任务,如GPT4Table[8]。
上一节总结并对RAG中表格关键技术进行了分类。在提出本文实现的解决方案之前,让我们探索一些开源解决方案。
LlamaIndex支持四种方法[9],前三种都是使用多模态模型:
根据本文提出方法进行分类总结:
通过试验发现,第三种方法的综合效果最好。然而,根据我的测试,第三种方法很难检测表格,更不用说正确地将表标题与表合并了。
Langchain还提出了一些解决方案,半结构化RAG[10]的关键技术包括:
如图5所示:
半结构化和多模态RAG[11]提出了三种解决方案,其架构如图6所示。
可选方案1:类似于本文的类别(l)。它包括使用多模态嵌入(如CLIP)来嵌入图像和文本,使用相似性搜索进行检索,并将原始图像和块传递给多模式LLM进行答案合成。
可选方案2:利用多模态LLM,如GPT-4V、LLaVA或FUYU-8b,从图像中生成文本摘要。然后,嵌入和检索文本,并将文本块传递给LLM进行答案合成。
可选方案3:使用多模态LLM(如GPT-4V、LLaVA或FUYU-8b)从图像中生成文本摘要,然后嵌入并检索参考原始图像的图像摘要(catogery(i)),然后将原始图像和文本块传递给多模态LLM。
本文对关键技术和现有解决方案进行了总结、分类和讨论。基于此,我们提出了以下解决方案,如图7所示。为了简单起见,省略了一些RAG模块,如重新排序和查询重写。
文档摘要索引结构(catogery(i)):小块的内容包括表格摘要,大块的内容包括LaTeX格式的相应表格和文本格式的表格标题。我们使用多向量检索器[12]来实现它;
表格摘要获取方法:将表格和表格标题发送给LLM进行摘要。
这种方法的优点是,它可以有效地解析表,同时综合考虑表摘要和表之间的关系,而且还不需要多模型LLM的需求,从而节省了成本。
Nougat[13]是在Donut[14]的基础上开发的。它通过网络隐式识别文本,不需要任何与OCR相关的输入或模块,如图8所示:
Nougat不仅可以解析表格数据,而且还可以解析公式,也可以方便地关联表标题,如图9所示:
Nougat是一个缺乏中间结果的端到端模型,它可能严重依赖于其训练数据。
根据格式化训练数据的代码[15],对于表格,紧接在\end{table}后面的行是caption_parts,这似乎与所提供的训练数据的格式一致:
def format_element(
element: Element, keep_refs: bool = False, latex_env: bool = False
) -> List[str]:
"""
Formats a given Element into a list of formatted strings.
Args:
element (Element): The element to be formatted.
keep_refs (bool, optional): Whether to keep references in the formatting. Default is False.
latex_env (bool, optional): Whether to use LaTeX environment formatting. Default is False.
Returns:
List[str]: A list of formatted strings representing the formatted element.
"""
...
...
if isinstance(element, Table):
parts = [
"[TABLE%s]\n\\begin{table}\n"
% (str(uuid4())[:5] if element.id is None else ":" + str(element.id))
]
parts.extend(format_children(element, keep_refs, latex_env))
caption_parts = format_element(element.caption, keep_refs, latex_env)
remove_trailing_whitespace(caption_parts)
parts.append("\\end{table}\n")
if len(caption_parts) > 0:
parts.extend(caption_parts + ["\n"])
parts.append("[ENDTABLE]\n\n")
return parts
...
...
优势:
缺点:
首先,安装相关的Python包
pip install langchain
pip install chromadb
pip install nougat-ocr
安装完成后,我们可以检查Python包的版本:
langchain 0.1.12
langchain-community 0.0.28
langchain-core 0.1.31
langchain-openai 0.0.8
langchain-text-splitters 0.0.1
chroma-hnswlib 0.7.3
chromadb 0.4.24
nougat-ocr 0.1.17
设置环境并导入:
import os
os.environ["OPENAI_API_KEY"] = "YOUR_OPEN_AI_KEY"
import subprocess
import uuid
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_openai import ChatOpenAI
from langchain.retrievers.multi_vector import MultiVectorRetriever
from langchain.storage import InMemoryStore
from langchain_community.vectorstores import Chroma
from langchain_core.documents import Document
from langchain_openai import OpenAIEmbeddings
from langchain_core.runnables import RunnablePassthrough
下载论文《Attention Is All You Need》[16]到YOUR_PDF_PATH,使用Nougat解析PDF文件,从解析结果中获得latex格式的表格和文本格式的表格标题。第一次执行将下载必要的模型文件。
def june_run_nougat(file_path, output_dir):
# Run Nougat and store results as Mathpix Markdown
cmd = ["nougat", file_path, "-o", output_dir, "-m", "0.1.0-base", "--no-skipping"]
res = subprocess.run(cmd)
if res.returncode != 0:
print("Error when running nougat.")
return res.returncode
else:
print("Operation Completed!")
return 0
def june_get_tables_from_mmd(mmd_path):
f = open(mmd_path)
lines = f.readlines()
res = []
tmp = []
flag = ""
for line in lines:
if line == "\\begin{table}\n":
flag = "BEGINTABLE"
elif line == "\\end{table}\n":
flag = "ENDTABLE"
if flag == "BEGINTABLE":
tmp.append(line)
elif flag == "ENDTABLE":
tmp.append(line)
flag = "CAPTION"
elif flag == "CAPTION":
tmp.append(line)
flag = "MARKDOWN"
print('-' * 100)
print(''.join(tmp))
res.append(''.join(tmp))
tmp = []
return res
file_path = "YOUR_PDF_PATH"
output_dir = "YOUR_OUTPUT_DIR_PATH"
if june_run_nougat(file_path, output_dir) == 1:
import sys
sys.exit(1)
mmd_path = output_dir + '/' + os.path.splitext(file_path)[0].split('/')[-1] + ".mmd"
tables = june_get_tables_from_mmd(mmd_path)
函数june_get_tables_from_mmd用于从图10所示的mmd文件中提取从t\begin{table}到\end{table}的所有内容,包括\end{table}后面的行。
值得注意的是,没有发现任何官方文件规定表格标题必须放在表格下方,或者表格应以\ begin{table}开头,以\ end{table}结尾。因此,june_get_tables_from_md是启发式的。
以下是解析PDF中表格的结果:
Operation Completed!
----------------------------------------------------------------------------------------------------
\begin{table}
\begin{tabular}{l c c c} \hline \hline Layer Type & Complexity per Layer & Sequential Operations & Maximum Path Length \\ \hline Self-Attention & \(O(n^{2}\cdot d)\) & \(O(1)\) & \(O(1)\) \\ Recurrent & \(O(n\cdot d^{2})\) & \(O(n)\) & \(O(n)\) \\ Convolutional & \(O(k\cdot n\cdot d^{2})\) & \(O(1)\) & \(O(log_{k}(n))\) \\ Self-Attention (restricted) & \(O(r\cdot n\cdot d)\) & \(O(1)\) & \(O(n/r)\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Maximum path lengths, per-layer complexity and minimum number of sequential operations for different layer types. \(n\) is the sequence length, \(d\) is the representation dimension, \(k\) is the kernel size of convolutions and \(r\) the size of the neighborhood in restricted self-attention.
----------------------------------------------------------------------------------------------------
\begin{table}
\begin{tabular}{l c c c c} \hline \hline \multirow{2}{*}{Model} & \multicolumn{2}{c}{BLEU} & \multicolumn{2}{c}{Training Cost (FLOPs)} \\ \cline{2-5} & EN-DE & EN-FR & EN-DE & EN-FR \\ \hline ByteNet [18] & 23.75 & & & \\ Deep-Att + PosUnk [39] & & 39.2 & & \(1.0\cdot 10^{20}\) \\ GNMT + RL [38] & 24.6 & 39.92 & \(2.3\cdot 10^{19}\) & \(1.4\cdot 10^{20}\) \\ ConvS2S [9] & 25.16 & 40.46 & \(9.6\cdot 10^{18}\) & \(1.5\cdot 10^{20}\) \\ MoE [32] & 26.03 & 40.56 & \(2.0\cdot 10^{19}\) & \(1.2\cdot 10^{20}\) \\ \hline Deep-Att + PosUnk Ensemble [39] & & 40.4 & & \(8.0\cdot 10^{20}\) \\ GNMT + RL Ensemble [38] & 26.30 & 41.16 & \(1.8\cdot 10^{20}\) & \(1.1\cdot 10^{21}\) \\ ConvS2S Ensemble [9] & 26.36 & **41.29** & \(7.7\cdot 10^{19}\) & \(1.2\cdot 10^{21}\) \\ \hline Transformer (base model) & 27.3 & 38.1 & & \(\mathbf{3.3\cdot 10^{18}}\) \\ Transformer (big) & **28.4** & **41.8** & & \(2.3\cdot 10^{19}\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: The Transformer achieves better BLEU scores than previous state-of-the-art models on the English-to-German and English-to-French newstest2014 tests at a fraction of the training cost.
----------------------------------------------------------------------------------------------------
\begin{table}
\begin{tabular}{c|c c c c c c c c|c c c c} \hline \hline & \(N\) & \(d_{\text{model}}\) & \(d_{\text{ff}}\) & \(h\) & \(d_{k}\) & \(d_{v}\) & \(P_{drop}\) & \(\epsilon_{ls}\) & train steps & PPL & BLEU & params \\ \hline base & 6 & 512 & 2048 & 8 & 64 & 64 & 0.1 & 0.1 & 100K & 4.92 & 25.8 & 65 \\ \hline \multirow{4}{*}{(A)} & \multicolumn{1}{c}{} & & 1 & 512 & 512 & & & & 5.29 & 24.9 & \\ & & & & 4 & 128 & 128 & & & & 5.00 & 25.5 & \\ & & & & 16 & 32 & 32 & & & & 4.91 & 25.8 & \\ & & & & 32 & 16 & 16 & & & & 5.01 & 25.4 & \\ \hline (B) & \multicolumn{1}{c}{} & & \multicolumn{1}{c}{} & & 16 & & & & & 5.16 & 25.1 & 58 \\ & & & & & 32 & & & & & 5.01 & 25.4 & 60 \\ \hline \multirow{4}{*}{(C)} & 2 & \multicolumn{1}{c}{} & & & & & & & & 6.11 & 23.7 & 36 \\ & 4 & & & & & & & & 5.19 & 25.3 & 50 \\ & 8 & & & & & & & & 4.88 & 25.5 & 80 \\ & & 256 & & 32 & 32 & & & & 5.75 & 24.5 & 28 \\ & 1024 & & 128 & 128 & & & & 4.66 & 26.0 & 168 \\ & & 1024 & & & & & & 5.12 & 25.4 & 53 \\ & & 4096 & & & & & & 4.75 & 26.2 & 90 \\ \hline \multirow{4}{*}{(D)} & \multicolumn{1}{c}{} & & & & & 0.0 & & 5.77 & 24.6 & \\ & & & & & & 0.2 & & 4.95 & 25.5 & \\ & & & & & & & 0.0 & 4.67 & 25.3 & \\ & & & & & & & 0.2 & 5.47 & 25.7 & \\ \hline (E) & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & & \multicolumn{1}{c}{} & & & & & 4.92 & 25.7 & \\ \hline big & 6 & 1024 & 4096 & 16 & & 0.3 & 300K & **4.33** & **26.4** & 213 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Variations on the Transformer architecture. Unlisted values are identical to those of the base model. All metrics are on the English-to-German translation development set, newstest2013. Listed perplexities are per-wordpiece, according to our byte-pair encoding, and should not be compared to per-word perplexities.
----------------------------------------------------------------------------------------------------
\begin{table}
\begin{tabular}{c|c|c} \hline
**Parser** & **Training** & **WSJ 23 F1** \\ \hline Vinyals \& Kaiser et al. (2014) [37] & WSJ only, discriminative & 88.3 \\ Petrov et al. (2006) [29] & WSJ only, discriminative & 90.4 \\ Zhu et al. (2013) [40] & WSJ only, discriminative & 90.4 \\ Dyer et al. (2016) [8] & WSJ only, discriminative & 91.7 \\ \hline Transformer (4 layers) & WSJ only, discriminative & 91.3 \\ \hline Zhu et al. (2013) [40] & semi-supervised & 91.3 \\ Huang \& Harper (2009) [14] & semi-supervised & 91.3 \\ McClosky et al. (2006) [26] & semi-supervised & 92.1 \\ Vinyals \& Kaiser el al. (2014) [37] & semi-supervised & 92.1 \\ \hline Transformer (4 layers) & semi-supervised & 92.7 \\ \hline Luong et al. (2015) [23] & multi-task & 93.0 \\ Dyer et al. (2016) [8] & generative & 93.3 \\ \hline \end{tabular}
\end{table}
Table 4: The Transformer generalizes well to English constituency parsing (Results are on Section 23 of WSJ)* [5] Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. _CoRR_, abs/1406.1078, 2014.
然后使用LLM对表格进行总结:
# Prompt
prompt_text = """You are an assistant tasked with summarizing tables and text. \
Give a concise summary of the table or text. The table is formatted in LaTeX, and its caption is in plain text format: {element} """
prompt = ChatPromptTemplate.from_template(prompt_text)
# Summary chain
model = ChatOpenAI(temperature = 0, model = "gpt-3.5-turbo")
summarize_chain = {"element": lambda x: x} | prompt | model | StrOutputParser()
# Get table summaries
table_summaries = summarize_chain.batch(tables, {"max_concurrency": 5})
print(table_summaries)
以下是在Attention Is All You Need[16]中找到的四个表的摘要,如图11所示:
使用Multi-Vector Retriever[12]构建文档摘要索引结构。
# The vectorstore to use to index the child chunks
vectorstore = Chroma(collection_name = "summaries", embedding_function = OpenAIEmbeddings())
# The storage layer for the parent documents
store = InMemoryStore()
id_key = "doc_id"
# The retriever (empty to start)
retriever = MultiVectorRetriever(
vectorstore = vectorstore,
docstore = store,
id_key = id_key,
search_kwargs={"k": 1} # Solving Number of requested results 4 is greater than number of elements in index..., updating n_results = 1
)
# Add tables
table_ids = [str(uuid.uuid4()) for _ in tables]
summary_tables = [
Document(page_content = s, metadata = {id_key: table_ids[i]})
for i, s in enumerate(table_summaries)
]
retriever.vectorstore.add_documents(summary_tables)
retriever.docstore.mset(list(zip(table_ids, tables)))
一切就绪,构建一个简单的RAG管道,并执行查询:
# Prompt template
template = """Answer the question based only on the following context, which can include text and tables, there is a table in LaTeX format and a table caption in plain text format:
{context}
Question: {question}
"""
prompt = ChatPromptTemplate.from_template(template)
# LLM
model = ChatOpenAI(temperature = 0, model = "gpt-3.5-turbo")
# Simple RAG pipeline
chain = (
{"context": retriever, "question": RunnablePassthrough()}
| prompt
| model
| StrOutputParser()
)
print(chain.invoke("when layer type is Self-Attention, what is the Complexity per Layer?")) # Query about table 1
print(chain.invoke("Which parser performs worst for BLEU EN-DE")) # Query about table 2
print(chain.invoke("Which parser performs best for WSJ 23 F1")) # Query about table 4
执行结果如下,表明几个问题得到了准确的回答,如图12所示:
整体代码如下:
import os
os.environ["OPENAI_API_KEY"] = "YOUR_OPEN_AI_KEY"
import subprocess
import uuid
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_openai import ChatOpenAI
from langchain.retrievers.multi_vector import MultiVectorRetriever
from langchain.storage import InMemoryStore
from langchain_community.vectorstores import Chroma
from langchain_core.documents import Document
from langchain_openai import OpenAIEmbeddings
from langchain_core.runnables import RunnablePassthrough
def june_run_nougat(file_path, output_dir):
# Run Nougat and store results as Mathpix Markdown
cmd = ["nougat", file_path, "-o", output_dir, "-m", "0.1.0-base", "--no-skipping"]
res = subprocess.run(cmd)
if res.returncode != 0:
print("Error when running nougat.")
return res.returncode
else:
print("Operation Completed!")
return 0
def june_get_tables_from_mmd(mmd_path):
f = open(mmd_path)
lines = f.readlines()
res = []
tmp = []
flag = ""
for line in lines:
if line == "\\begin{table}\n":
flag = "BEGINTABLE"
elif line == "\\end{table}\n":
flag = "ENDTABLE"
if flag == "BEGINTABLE":
tmp.append(line)
elif flag == "ENDTABLE":
tmp.append(line)
flag = "CAPTION"
elif flag == "CAPTION":
tmp.append(line)
flag = "MARKDOWN"
print('-' * 100)
print(''.join(tmp))
res.append(''.join(tmp))
tmp = []
return res
file_path = "YOUR_PDF_PATH"
output_dir = "YOUR_OUTPUT_DIR_PATH"
if june_run_nougat(file_path, output_dir) == 1:
import sys
sys.exit(1)
mmd_path = output_dir + '/' + os.path.splitext(file_path)[0].split('/')[-1] + ".mmd"
tables = june_get_tables_from_mmd(mmd_path)
# Prompt
prompt_text = """You are an assistant tasked with summarizing tables and text. \
Give a concise summary of the table or text. The table is formatted in LaTeX, and its caption is in plain text format: {element} """
prompt = ChatPromptTemplate.from_template(prompt_text)
# Summary chain
model = ChatOpenAI(temperature = 0, model = "gpt-3.5-turbo")
summarize_chain = {"element": lambda x: x} | prompt | model | StrOutputParser()
# Get table summaries
table_summaries = summarize_chain.batch(tables, {"max_concurrency": 5})
print(table_summaries)
# The vectorstore to use to index the child chunks
vectorstore = Chroma(collection_name = "summaries", embedding_function = OpenAIEmbeddings())
# The storage layer for the parent documents
store = InMemoryStore()
id_key = "doc_id"
# The retriever (empty to start)
retriever = MultiVectorRetriever(
vectorstore = vectorstore,
docstore = store,
id_key = id_key,
search_kwargs={"k": 1} # Solving Number of requested results 4 is greater than number of elements in index..., updating n_results = 1
)
# Add tables
table_ids = [str(uuid.uuid4()) for _ in tables]
summary_tables = [
Document(page_content = s, metadata = {id_key: table_ids[i]})
for i, s in enumerate(table_summaries)
]
retriever.vectorstore.add_documents(summary_tables)
retriever.docstore.mset(list(zip(table_ids, tables)))
# Prompt template
template = """Answer the question based only on the following context, which can include text and tables, there is a table in LaTeX format and a table caption in plain text format:
{context}
Question: {question}
"""
prompt = ChatPromptTemplate.from_template(template)
# LLM
model = ChatOpenAI(temperature = 0, model = "gpt-3.5-turbo")
# Simple RAG pipeline
chain = (
{"context": retriever, "question": RunnablePassthrough()}
| prompt
| model
| StrOutputParser()
)
print(chain.invoke("when layer type is Self-Attention, what is the Complexity per Layer?")) # Query about table 1
print(chain.invoke("Which parser performs worst for BLEU EN-DE")) # Query about table 2
print(chain.invoke("Which parser performs best for WSJ 23 F1")) # Query about table 4
本文讨论了RAG过程中表个处理的关键技术和现有解决方案,并提出了一个解决方案及其实现。
在本文中,我们使用Nougat来解析表。然而,如果有更快、更有效的解析工具,我们会考虑取代Nougat。我们对工具的态度是先有正确的想法,然后找到工具来实现它,而不是依赖于某个工具。
在本文中,我们将所有表内容输入到LLM中。然而,在实际场景中,我们应该考虑表格内容超过LLM上下文长度的情况。我们可以通过使用一种有效的分块方法来解决这个问题。
[1] https://openai.com/research/gpt-4v-system-card
[2] https://github.com/microsoft/table-transformer
[3] https://unstructured-io.github.io/unstructured/best_practices/table_extraction_pdf.html
[4] https://pub.towardsai.net/advanced-rag-02-unveiling-pdf-parsing-b84ae866344e
[5] https://github.com/facebookresearch/nougat
[6] https://github.com/clovaai/donut/
[7] https://aclanthology.org/2020.acl-main.398.pdf
[8] https://arxiv.org/pdf/2305.13062.pdf
[9] https://docs.llamaindex.ai/en/stable/examples/multi_modal/multi_modal_pdf_tables.html
[10] https://github.com/langchain-ai/langchain/blob/master/cookbook/Semi_Structured_RAG.ipynb?ref=blog.langchain.dev
[11] https://github.com/langchain-ai/langchain/blob/master/cookbook/Semi_structured_and_multi_modal_RAG.ipynb
[12] https://python.langchain.com/docs/modules/data_connection/retrievers/multi_vector
[13] https://arxiv.org/pdf/2308.13418.pdf
[14] https://arxiv.org/pdf/2111.15664.pdf
[15] https://github.com/facebookresearch/nougat/blob/main/nougat/dataset/parser/markdown.py
[16] https://arxiv.org/pdf/1706.03762.pdf
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。