ทำให้เอกสารองค์กรของคุณพร้อมสำหรับ AI — อย่างเชื่อถือได้ ทำงานภายในเครื่อง และมีความหมายเชิงโครงสร้าง
เป็นเรื่องปกติที่องค์กรเก็บเอกสารของตนในรูปแบบ PDF, DOCX, XLSX และ ePub. แม้ว่า LLM (large language models) จะทำงานได้ดีกับ HTML หรือข้อความธรรมดา แต่รูปแบบเอกสารดั้งเดิมเหล่านี้จำเป็นต้องแปลงก่อนจึงจะใช้ได้อย่างมีประสิทธิภาพใน pipeline ของ LLM + RAG ที่เราต้องการให้ผู้ใช้สนทนากับเอกสารหรือชุดเอกสารได้
LLM (Large Language Model) — โมเดล AI ที่ถูกฝึกล่วงหน้าเพื่อสร้างข้อความและตอบคำถามโดยอ้างอิงจากคอร์ปัสข้อความขนาดใหญ่
RAG (Retrieval‑Augmented Generation) — วิธีการที่ผสาน LLM กับฐานความรู้ภายนอก (เช่น เอกสารองค์กร) เพื่อให้โมเดลสามารถดึงและอ้างอิงเนื้อหาของโดเมนได้
ไดอะแกรมลำดับต่อไปนี้แสดงขั้นตอนทั่วไปในการสร้างคำตอบสำหรับคำถาม:
คุณภาพของคำตอบที่คุณได้รับจาก System (LLM + RAG) ขึ้นอยู่ทั้งกับ System เองและกับการที่เอกสารต้นทางยังคงรักษาโครงสร้างและความหมายไว้เมื่อถูกส่งเข้าสู่ pipeline การดึงข้อมูล
ปัญหา
การจัดรูปแบบเอกสารไม่ได้เป็นเพียงแค่การมองเห็นเท่านั้น — มันยังบรรจุความหมายด้วย. หัวเรื่อง, รายการ, ตาราง, การเน้นแบบหนา/เอียง, คำอธิบายใต้ภาพ, และรูปภาพในบรรทัดเดียวทั้งหมดสื่อสารความหมายที่ช่วยให้ LLM เข้าใจบริบทได้. การแปลงเอกสารแบบไม่คำนึงถึงโครงสร้าง (เช่น ใช้ OCR ที่มองเห็นทุกหน้าว่าเป็นภาพแบน) มักทำให้ความหมายเหล่านี้หายไป. ผลก็คือการดึงข้อมูลใน RAG และคำตอบของ LLM ที่ตามมามักไม่แม่นยำหรือมีเสียงรบกวน
OCR มีประโยชน์สำหรับเอกสารที่สแกนแล้ว แต่บ่อยครั้งทำลายโครงสร้าง (เช่น รายการที่ตัดขาดระหว่างหน้า, เส้นขอบของตารางที่อ่านผิด, คำอธิบายที่หาย) รวมถึงเพิ่มค่าใช้จ่ายและความซับซ้อนของโครงสร้างพื้นฐานเมื่อประมวลผลคลังเอกสารขนาดใหญ่
วิธีแก้ปัญหา
วิธีทางเลือกคือการแปลงเอกสารโดยคำนึงถึงโครงสร้างและส่งออกโครงสร้างนั้นไปยังรูปแบบที่เป็นมิตรกับ LLM — Markdown. Markdown มีน้ำหนักเบา, รองรับอย่างกว้างขวาง, และคงไว้ซึ่งหัวเรื่อง, รายการ, ตาราง, code block, การเน้น, คำอธิบาย, และการอ้างอิงรูปภาพ — คุณสมบัติเพิ่มเติมที่ช่วยปรับปรุงคุณภาพการดึงข้อมูล
GroupDocs.Markdown for .NET จะแปลงรูปแบบเอกสารยอดนิยม (PDF, DOCX, XLSX, ePub ฯลฯ) ไปเป็น Markdown ที่เป็น semantic และพร้อมสำหรับการนำเข้าในระบบ RAG. เป็นไลบรารี .NET ที่ทำงานแบบ on‑premise ทั้งหมดจึงไม่มีบริการภายนอก, ไม่เกิดการรั่วไหลของข้อมูล, และไม่มีการพึ่งพา GPU ระยะไกล
วิธีเริ่มต้น
GroupDocs.Markdown for .NET มีให้ดาวน์โหลดเป็นแพ็กเกจ NuGet, ไฟล์ MSI และ ZIP
ติดตั้งแพ็กเกจ NuGet ผ่าน .NET CLI:
dotnet add package GroupDocs.Markdown
หรือดาวน์โหลดไฟล์ติดตั้งและ assembly จากหน้า downloads อย่างเป็นทางการ: https://releases.groupdocs.com/markdown/net/
ตัวอย่างการใช้งาน (ใส่ลงใน Program.cs):
// Import the namespace
using GroupDocs.Markdown;
// Set the license (optional for evaluation)
License.Set("GroupDocs.Markdown.lic");
// Instantiate the converter for a source document
var converter = new MarkdownConverter("rich-text-formatting.docx");
// Convert and save output to file
converter.Convert("rich-text-formatting.md");
ไฟล์ rich-text-formatting.md ที่แปลงแล้วจะถูกบันทึกในโฟลเดอร์เดียวกับแอปพลิเคชันของคุณ
ภาพต่อไปนี้แสดงไฟล์ DOCX อินพุตและ Markdown ผลลัพธ์
หากคุณรันโดยไม่มีลิขสิทธิ์ โหมดประเมินผลจะประมวลผลจำนวนหน้าจำกัด (เช่น 3 หน้าแรก). หากต้องการทดลองเต็มเวอร์ชัน ให้ขอ temporary license.
เพื่อขอ temporary license ให้เปิด Purchase Wizard, ใส่ข้อมูลติดต่อ, แล้วคลิก Get a temporary license ในขั้นตอน Contact Details. ลิขสิทธิ์ชั่วคราวจะถูกส่งทางอีเมลให้คุณ
เรียนรู้เพิ่มเติมเกี่ยวกับลิขสิทธิ์ชั่วคราว: https://purchase.groupdocs.com/temporary-license/
ฟอร์แมตไฟล์ที่รองรับ
GroupDocs.Markdown for .NET รองรับไฟล์รูปแบบทั่วไปขององค์กรและอีบุ๊กเป็นจำนวนมาก รายการส่วนขยายที่รองรับทั้งหมด:
- PDF
pdf
- Spreadsheets
.xls,.xlsx,.xlsb,.xlsm,.xlt,.xltx,.xltm,.xlam,.csv,.tsv,.ods,.ots,.fods,.numbers,.sxc
- Word / Rich Text
.doc,.docx,.dot,.dotm,.dotx,.docm,.rtf,.odt,.ott
- Ebooks
.azw3,.mobi,.epub
- Text / Markup / Help
.chm,.xml,.txt
วิธีทำงาน (ภายใน — ระดับสูง)
เมื่อเอกสารถูกประมวลผล จะเกิดขั้นตอนหลักสองขั้นตอน:
-
การสกัดโมเดลเอกสาร
เอกสารจะถูกพาร์เซเป็นโมเดลออบเจ็กต์ในหน่วยความจำที่แทนส่วนประกอบโครงสร้าง (ย่อหน้า, หัวเรื่อง, รายการ, ตาราง, รูปภาพ, หมายเหตุ, คำอธิบาย ฯลฯ). พาร์เซจะพยายามคงไว้ซึ่งความหมาย (เช่น การซ้อนรายการ, เซลล์ตาราง, คำอธิบายรูป). -
การสร้าง Markdown
โมเดลออบเจ็กต์นั้นจะถูกเดินตามและแปลงเป็น Markdown ตามตัวเลือกการแปลงที่กำหนด (วิธีจัดการรูป, การฟอร์แมตตาราง, ระดับหัวเรื่อง, คำอธิบายพิเศษ ฯลฯ). ผลลัพธ์คือไฟล์ Markdown ที่อ่านง่ายและมีความหมายเชิงโครงสร้าง พร้อมสำหรับการทำดัชนีโดย pipeline RAG ของคุณ
ตัวอย่างการส่งออก
โค้ดข้างต้นแสดงวิธีส่งออก DOCX ไปเป็น Markdown. มาดูไฟล์ต้นฉบับและไฟล์ผลลัพธ์เป็นตัวอย่าง
Source DOCX
ไฟล์ต้นฉบับ rich-text-formatting.docx มีบล็อกเนื้อหาต่าง ๆ และถูกฟอร์แมตอย่างเข้มข้นเพื่อเน้นองค์ประกอบเชิงความหมายหลัก
Output Markdown
เนื้อหาผลลัพธ์ของ rich-text-formatting.md แสดงด้านล่างว่าองค์ประกอบฟอร์แมตต่าง ๆ ถูกแทนด้วย Markdown อย่างไร
This document contains a variety of formatted elements that are used to test document rendering quality during file conversion
# <a name="_toc76372684"></a>**Font Formatting**
Source Sans Pro Light, 14 pt.
Simple text in Times New Roman 12 followed by an empty paragraph<sub>subscript</sub> and<sup>superscript</sup>.
Various characters: ‘ “ & < > £ ¥ § ¨ © ª « ® » ¼
Paragraph with multiple segments of text formatted in different fonts, sizes and colors. Very different sizes and colors including **bold**, *italic*, underline and 1 2 3 4 5 ~~strikethrough~~. Make sure that the lines wrapped in the same way in Word and in Pdf.
This text has shading and highlighting and borders, and it is supported.
# <a name="_toc76372685"></a>**Paragraph Formatting**
Paragraph shading should not form empty gaps even with spacing 12 after.
Centered paragraph with a line break had a problem.\
Centered paragraph with a line break had a problem.
Right aligned paragraphs must be right aligned properly.
Right aligned paragraph with line break works well.\
Right aligned paragraph with line break works well.
This paragraph has a border.
Right aligned condensed text had a problem.
Right aligned expanded text had a problem.
Spacing after and before do not add up, just the greater is used. This paragraph has 12 after. Also, when indents are different, the shading does not join.
This paragraph has 12 before, but in total there is only 12 above. Also note that shading belongs to the paragraph at the top and shading of this paragraph does not go down unless next paragraph has shading too. There are 24 points below.
There are 24 points above, but the gap between this and previous paragraph is only 24.
This paragraph is a test for double line spacing. This paragraph is a test for double line spacing. It also have 0.5” for the first line.
This is a test for 1.5 line spacing. This is a test for 1.5 line spacing. Also has -0.5” indent for the first line.
This paragraph has a page break
and centered. It actually creates two paragraphs.
This is a test for Exactly 20 points of spacing. This is a test for Exactly 20 points of spacing. TTTTTT (20, 22, 24, 26, 28, 30).
There is a continuous section break after this line.
This line is in the new section. Next here is an empty section.
This line is in the fourth section.
# <a name="_toc76372686"></a>**Paragraph Justify**
This is a justified paragraph with a single segment. 111111111111111111111111111111111111111111.
Also a justified **paragraph** reset to left because of multiple segments. 111111111111111111111111111111111111111111.
# **Non‑English Characters**
Wingdings: (x, Symbol: WÄ
Russian: Теперь немного по русски.
# <a name="_toc76372687"></a>**Tables**
|Cell 1.1 Left|Cell 1.2 Right|||
| :- | -: | :- | :- |
|Cell 2.1 Centered vertically|Cell 2.2 with background|Cell 2.3 with line break<br>and coloured border.||
|Cell 3.1 Bottom vertically|<p>Cell 3.2</p><p>Centered</p><p>Horizontally</p>|Cell 3.3 No border||
|Left red, blue top, green right and yellow bottom.|
| :- |
|Table with left indent and merged cells.||||
| :- | :- | :- | :- |
|||||
|||||
**Cell padding etc.**
|<p>Cell padding.</p><p>Top: 0.1, bottom 0.2</p><p>Left: 0.5, Right 0.4</p>|Zero padding on all sides, right aligned.|
| :- | -: |
|Outer 1.1|Outer 1.2. There is a nested table here||
| :- | :-: | -: |
|**Nested 1.1**|**Nested 1.2**|
| :- | :- |
|||Outer 1.3|
| :- | :-: | -: |
#
# <a name="_toc76372688"></a>**Lists**
**Numbered list:**
1. Item 1
1. Item 2
1. Item 2.1
1. Item 2.2
1. Item 3
**Bulleted list:**
- Item 1
- Item 2
- Item 2.1
- Item 2.2
- Item 3
#
# <a name="_toc76372689"></a>**Images**
This section starts from a new page.
**Ellipse text**
There is an image in a black border in the top right corner, but it will drop down into the text. There is also a transparent ellipse with text that overlaps the picture.
Inline JPEG in a separate paragraph.

|||
| :- | -: |
---
### กล่องข้อความแบบอินไลน์
 คือ ***นี่คือข้อความในกล่อง*** และรูปวงรีใสที่ซ้อนทับกันอยู่
---
### ส่วนใหม่เริ่มจากหน้าใหม่
มีการจัดหน้าแบบแนวตั้งพร้อมระยะขอบ
# <a name="_toc76372690"></a>**Fields**
ฟิลด์การรวม «FirstName»
เลขหน้า 5
ลิงก์ [Aspose.com](http://www.aspose.com)
สารบัญ
[Font Formatting 1](#_toc76372684)
[Paragraph Formatting 1](#_toc76372685)
[Non‑English Characters 2](#_toc76372686)
[Tables 2](#_toc76372687)
[Lists 2](#_toc76372688)
[Images 4](#_toc76372689)
[Fields 5](#_toc76372690)
# **Form Fields**
แก้ไข <a name="text1"></a>ข้อความทดสอบ
กล่องทำเครื่องหมาย <a name="check1"></a>
คอมบ็อกซ์ <a name="dropdown1"></a>
# **Footnotes and Endnotes**
บรรทัดนี้มีเชิงอรรถที่ส่วนท้าย.[^1]
บรรทัดนี้มีอธิบายต่อท้าย.[^2]
[^1]: เชิงอรรถ 1.
[^2]: อธิบายต่อ 1.
---
## สรุป
**GroupDocs.Markdown for .NET** จะช่วยให้คุณแปลงเอกสารหลากหลายรูปแบบให้เป็น Markdown ที่มีโครงสร้างเชิงความหมาย พร้อมใช้งานกับระบบ **LLM + RAG**. มันคงโครงสร้างและความหมายของเอกสาร, ทำงานบน‑premise, และรองรับรูปแบบเอกสารระดับองค์กรทั่วไป — ทำให้เป็นตัวเลือกที่ใช้งานได้จริงสำหรับองค์กรที่ต้องเตรียมคอลเลคชันเอกสารขนาดใหญ่สำหรับการประมวลผล AI
---
## เรียนรู้เพิ่มเติม
- หน้าแรกของผลิตภัณฑ์: https://products.groupdocs.com/markdown/net/
- เอกสาร: https://docs.groupdocs.com/markdown/net/
- ข้อมูลลิขสิทธิ์: https://about.groupdocs.com/legal/
- ดาวน์โหลด: https://releases.groupdocs.com/markdown/net/
---
## สนับสนุน & คำติชม
สำหรับคำถามหรือขอความช่วยเหลือด้านเทคนิค โปรดใช้ [Free Support Forum](https://forum.groupdocs.com/) — เราจะยินดีให้ความช่วยเหลือคุณ