Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
LemonWiki共筆
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
PDF Table Parsing in Mandarin
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 1. 術語說明 === '''解析器(Parser)''' <code>parser</code> 是負責解析 PDF 內容,並將其轉換為結構化資料的程式。它通常不只是讀取文字或表格,還需要辨識章節、表格類型、欄位位置、資料列、接續內容,以及來源中繼資料。 '''資料紀錄(Record)''' <code>record</code> 是解析器產出的一筆標準化資料。 PDF 中的一列不一定對應一筆資料紀錄。同一筆紀錄可能分散在多列、跨頁接續,或需要繼承父列的資訊後才算完整。 '''章節/子章節(Section / Subsection)''' <code>section</code> 與 <code>subsection</code> 分別指文件中的章節與子章節。 這些欄位通常用來描述資料的來源脈絡,例如某筆紀錄來自哪個章節或表格區塊。 '''表格類型(Table Type)''' <code>table_type</code> 是由解析器自行定義的表格類型標籤,用來表示目前表格屬於哪一種資料結構。 例如: * <code>summary_table</code>:摘要表 * <code>detail_table</code>:明細表 * <code>parent_child_table</code>:父子關係表 * <code>cross_reference_table</code>:交叉參照表 * <code>unknown_table</code>:未知類型表格 <code>table_type</code> 的用途,是協助解析器判斷應套用哪一組解析規則。 它不是 PDF 的內建欄位,也不是 <code>pdfplumber</code>、Camelot 或 Tabula 會自動提供的資訊。 '''表格結構定義(Table Schema)''' <code>table schema</code> 指特定表格類型的欄位結構與解析規則。 通常包含欄位數量、欄位順序、標準化欄位名稱、欄位別名、必填欄位、允許空值的欄位,以及是否需要特殊的接續處理或父子列處理。 在 PDF 表格解析中,<code>table schema</code> 不一定是資料庫綱要,而是解析器用來對齊與標準化表格資料的一組規則。 '''欄位對應(Column Mapping)''' <code>column mapping</code> 指將 PDF 原始欄位對應至標準化欄位的過程。 例如,不同文件可能使用「項目名稱」、「物件名稱」或「標的名稱」等欄名,但在輸出資料時,都可以統一為 <code>item_name</code>。 '''別名對應(Alias Mapping)''' <code>alias mapping</code> 指欄名別名的對照表。 由於 PDF 表格的欄名經常因版本、格式或填報單位而異,解析器需要將多種欄名對應至同一個標準化欄位。 '''向下填補(Forward-Fill)''' <code>forward-fill</code> 指讓後續資料列繼承前面資料列欄位值的處理方式。 在父子列結構中,父列可能只出現一次,後續子列則省略重複資訊。此時,解析器需要將父列資訊填入各個子列。 '''父列/子列(Parent Row / Child Row)''' <code>parent row</code> 是提供主要分類、群組或摘要資訊的資料列。 <code>child row</code> 是隸屬於某個父列的明細資料列。 PDF 表格經常由父列列出主要資訊,子列則只列出明細項目。如果未處理父子列關係,輸出資料可能會遺失必要的脈絡。 '''跨頁接續(Cross-Page Continuation)''' <code>cross-page continuation</code> 指同一筆資料紀錄被拆開,並接續至下一頁的情況。 名稱、說明文字、分類欄位、備註或其他較長的欄位,都可能發生這種情況。 處理跨頁接續時,需要判斷下一頁的文字是否屬於上一頁尚未完成的紀錄,而非直接將其視為新的資料列。 '''中繼資料(Metadata)''' <code>metadata</code> 指用來描述資料來源與解析狀態的輔助資訊。 常見欄位包括 <code>page</code>、<code>table_index</code>、<code>table_type</code>、<code>section</code>、<code>subsection</code>、<code>source_file</code>、<code>raw_row</code> 與 <code>parse_warning</code>。 中繼資料有助於除錯、稽核、資料溯源與資料品質檢查。
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki共筆:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)