ยินดีด้วย!

Graph RAG ด้วย LangChain และ Neo4j

Adam Cowley

Manager, Developer Education at Neo4j

บทที่ 1

ข้อความ Vector Embedding
He's just a city boy born [0.12, -0.34, 0.56, 0.78, ..., -0.91]
born and raised in South Detroit [0.22, 0.45, -0.67, 0.11, ..., 0.33]
He took the midnight train [-0.55, 0.89, 0.12, -0.44, ..., 0.67]
going anywhere [0.78, -0.23, 0.45, 0.91, ..., -0.12]

แผนภาพกราฟแสดงเอนทิตีที่กล่าวถึงในเนื้อเพลง Don't Stop Believing โดยมี small town boy เชื่อมกับ South Detroit ด้วยความสัมพันธ์ BORN และ RAISED

Graph RAG ด้วย LangChain และ Neo4j

บทที่ 1

แผนภาพโหนดแสดง Book และความสัมพันธ์ WRITTEN_BY สองเส้นไปยังผู้แต่ง เพื่อแสดงว่าโหนดหนึ่งโหนดสามารถมีหลายความสัมพันธ์ได้

Graph RAG ด้วย LangChain และ Neo4j

บทที่ 1

ผลลัพธ์ที่ได้ถูกนำไปแทรกใน prompt เพื่อส่งต่อไปยัง LLM

Graph RAG ด้วย LangChain และ Neo4j

บทที่ 2

แผนภาพแสดงโครงสร้างลำดับชั้น: เอกสารหนึ่งฉบับเชื่อมกับหลายหน้า และแต่ละหน้ามีโหนด chunk หลายโหนดเชื่อมอยู่

act_splitter = RecursiveCharacterTextSplitter(
    # Split text into acts
    separators=[ r"\n\nTHE PROLOGUE.",  r"\n\nACT",
                 r"\n\n\*\*\* END"],
    is_separator_regex=True
)

scene_splitter = RecursiveCharacterTextSplitter(
    # Split act into scenes
    separators=[r"\nSCENE "],
    is_separator_regex=True
)
Graph RAG ด้วย LangChain และ Neo4j

บทที่ 2

คุณสมบัติข้อความบนโหนดถูกนำไปสร้าง embedding

Graph RAG ด้วย LangChain และ Neo4j

บทที่ 2

ตัวอย่างโมเดลกราฟโดเมน แสดงบุคคลที่ทำงานในบริษัท ซึ่งตั้งอยู่ที่อยู่แห่งหนึ่ง บุคคลถือบัตรเครดิตที่มีการสั่งซื้อกับบริษัทในตำแหน่งเดียวกัน

Graph RAG ด้วย LangChain และ Neo4j

บทที่ 3

entity_resolution5.jpg

Graph RAG ด้วย LangChain และ Neo4j

บทที่ 3

 

ragas.png

 

  • Context Precision: วัดสัดส่วนของ chunk ที่เกี่ยวข้องในเอกสารที่ดึงมา
  • Noise Sensitivity: วัดปริมาณข้อมูลที่ไม่เกี่ยวข้องในเอกสารที่ดึงมา
Graph RAG ด้วย LangChain และ Neo4j

บทที่ 3

Graph RAG ด้วย LangChain และ Neo4j

graph_academy.png

1 https://graphacademy.neo4j.com/
Graph RAG ด้วย LangChain และ Neo4j

มาฝึกกันเถอะ!

Graph RAG ด้วย LangChain และ Neo4j

Preparing Video For Download...