RAG | Örnekler ile Chunking Aşaması
Chunking, LLM modellerinin spesifik veriler üzerinde kullanımını kolaylaştıran RAG yapısının ilk adımıdır. Kaynak gösterilen dosyaların probleme bağlı olarak belirlenen bir metot çerçevesinde küçük parçalara ayrıştırılmasını sağlar. Bu işlem adımı vektör veritabanından aldığımız içeriğin alaka düzeyini optimize etmemize yardımcı olur.
Bir LLM uygulama geliştiricisinin RAG yapısını inşaa ederken vermesi gereken ilk karar hangi cunking metodunu kullanacağıdır. Probleme yönelik etkili bir chunking işlemi arama sonuçlarının iyileştirilmesini ve kullanıcının daha doğru çıktı almasına yardımcı olur. Eğer chunklar (parçalar) çok küçükse anlamsız/eksik sonuçlara neden olur. Eğer çok büyükse ilgili içeriği kaçırmaya sebep olur. Bu nedenle en uygun chunk boyutunu bulmak oldukça önemlidir.
Örneğin; elinizde yasaların bulunduğu bir kaynak var. Bu kaynağı kullanalarak sorulan soruya uygun yasayı eksiksiz ve yorumsuz bir şekilde çıktı olarak vermesini istiyorsunuz. Eğer yanlış chunking metodu seçtiyseniz elde edeceğiniz çıktı yarım olabilir. Yani yasanın yarısı arama yaptığı chunk içinde kalan yarısı bir sonraki chunkta yer alabilir. Bu durumda eksik çıktı döndürürsünüz ve uygulamanız işe yaramaz hale gelir.
Bu gibi durumların önüne geçmek ve doğru metodu bulmanız oldukça önemlidir.
Chunking Metotları
Literatürden birbirinden farklı chunking metotları mevcuttur. Bu metotların her birinin güçlü ve zayıf yönleri vardır. Bu sebepten uygulama geliştiricisi kendi problemini doğru analiz edip en uygun metodu seçmesi gerekir.
Langchain ve LlamaIndex frameworkleri ile bu işlemleri gerçekleştirmek oldukça kolaydır. Metotlar Langchain ile örneklendirilmiştir.
1- Sabit Boyutlu Chunking
Sabit boyutlu chunking, metni parçalamanın en kaba ve basit halidir. Metini karakter yada token sayısına göre belirli uzunlukta chunklara ayırmaya yardımcı olur. Overlap (örtüşme) yaparak chunkların belirli bir kısmını bi sonraki chunkta da yer almasını sağlayabiliriz. Bu sayede daha az yada hiç yanlış cevap vermeden çıktı üretebiliriz.
Karakter bazlı parçalamanın bir örneği:
Tüm örnekler için “What_ is_Lorem_Ipsum.txt” dosyası işleme alınmıştır.
with open("What_ is_Lorem_Ipsum.txt") as f:
text = f.read() #read data
from langchain_text_splitters import CharacterTextSplitter
fix_text_splitter = CharacterTextSplitter(
chunk_size=800,
chunk_overlap=200,
)
fix_chunk = fix_text_splitter.create_documents([text])
fix_chunk
Çıktı:
[Document(page_content="What is Lorem Ipsum?\nLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
Document(page_content="Why do we use it?\nIt is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."),
Document(page_content='Where does it come from?\nContrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.\nThe standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.\nThe standard Lorem Ipsum passage, used since the 1500s\n"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."\nSection 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC\n"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"')]
chunk_size: Bir parçada yer alacak karakter sayısını verir.
chunk_overlap: Bir önceki parçanın sondan kaç karakterini alıp yeni parçaya ekleyeceğini belirler. Yani birbirini izleyen parçalar arasında çakışan karakter sayısını verir.
2- Recursive Chunking
Recursive Chunking, metni ayraçlar yardımı ile hiyerarşik olarak parçalamamıza yardımcı olur. Metni ilk parçalama girişimi istenen boyutta ya da yapıda sonuç üretmezse, yöntem istenen chunk boyutu ya da yapısı elde edilene kadar farklı bir ayırıcı ile çıkan chunklarda tekrarlayan bir şekilde kendini çağırır. Bu parçalar sabit boyutlu chunking metodundaki gibi aynı boyutlarda olmayabilir ancak benzer boyutta olmayı hedefleyerek çıktı üretir.
Model ilişkili cümleleri bir arada tutabilmek için, ilk en büyük ayırıcı (“\n\n”) ile başlar. Ortaya çıkan chunkların tümü önceden tanımlanmış chunk_size değerinden küçükse durur. Ancak herhangi bir chunk chunk_size değerinden büyükse, bir sonraki ayırıcıya (“\n”) geçer ve işlemi bu büyük parça üzerinde tekrarlar.
"\n\n": Paragraf
"\n" : Satır
" " : Boşluk
"" : Karakter
Bu method sabit boyutlu chunking metoduna göre;
- Açıkça hiyerarşik yapıya sahip belgeler için daha etkilidir.
- Cümleleri veya kelimeleri ortasında kesme olasılığını azaltır.
- Daha iyi performans gösterir
Aynı data ile yapılan Recursive örneği;
from langchain_text_splitters import RecursiveCharacterTextSplitter
recursive_text_splitter = RecursiveCharacterTextSplitter(
chunk_size=800,
chunk_overlap=200,
length_function=len,
is_separator_regex=False,
)
recursive_chunk = recursive_text_splitter.create_documents([text])
recursive_chunk
Çıktı:
[Document(page_content="What is Lorem Ipsum?\nLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
Document(page_content="Why do we use it?\nIt is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."),
Document(page_content='Where does it come from?\nContrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.'),
Document(page_content='The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.\nThe standard Lorem Ipsum passage, used since the 1500s\n"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."'),
Document(page_content='Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC'),
Document(page_content='"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae'),
Document(page_content='quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"')]
Elde edilen çıktı bir sabit boyutlu chunking metodu ile aynı size ve overlap bilgilerine sahip olmasına rağmen chunkların farklı ayırdığını görmek mümkündür.
3- Document Specific Chunking
Document Specific Chunking, içeriğin yapısı korunarak belirlenen koşulda hiyerarşik parçalama yapar. Belirli bir alan, içerik türü veya işleme gereksinimine göre özel olarak uyarlanmış bu teknik, genel chunking yöntemlerinden farklı olarak bir bağlama veya uygulamaya göre optimize edilmiştir . Markdown, Latex, HTML Splitter gibi bir çok modeli vardır.
MarkDown chunking metodu özelindeki örnek:
with open("What_ is_Lorem_Ipsum_markdown.txt") as f:
text_markdown = f.read()
from langchain_text_splitters import MarkdownHeaderTextSplitter
headers_to_split_on = [
("#", "Header 1"),
("##", "Header 2")
]
markdown_splitter = MarkdownHeaderTextSplitter(headers_to_split_on=headers_to_split_on)
md_header_chunk = markdown_splitter.split_text(text_markdown)
md_header_chunk
Çıktı:
[Document(page_content="# What is Lorem Ipsum? \n## Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", metadata={'Header 1': 'What is Lorem Ipsum?', 'Header 2': "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."}),
Document(page_content="# Why do we use it? \n## It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).", metadata={'Header 1': 'Why do we use it?', 'Header 2': "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."}),
Document(page_content='# Where does it come from? \n## Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.', metadata={'Header 1': 'Where does it come from?', 'Header 2': 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.'}),
Document(page_content='## The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.', metadata={'Header 1': 'Where does it come from?', 'Header 2': 'The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.'}),
Document(page_content='## The standard Lorem Ipsum passage, used since the 1500s', metadata={'Header 1': 'Where does it come from?', 'Header 2': 'The standard Lorem Ipsum passage, used since the 1500s'}),
Document(page_content='## "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."', metadata={'Header 1': 'Where does it come from?', 'Header 2': '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."'}),
Document(page_content='## Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC', metadata={'Header 1': 'Where does it come from?', 'Header 2': 'Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC'}),
Document(page_content='## "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"', metadata={'Header 1': 'Where does it come from?', 'Header 2': '"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"'})]
Bu çıktı için dosya özel olarak hazırlanmalı. Bu sayede belirlenen işarete göre (bu örnek için; # ve ##) ayrıştırma işlemi gerçekleştirilir. Headerlar, Document için aşağıdaki gibi ayrıştırılır.
metadata={'Header 1': 'Where does it come from?', 'Header 2': 'The standard Lorem Ipsum passage, used since the 1500s'}),
4- Semantic Chunking
Semantic Chunking, embed edilmiş değerlerden anlam çıkarmayı ve ardından bu parçalar arasındaki anlamsal ilişkiyi değerlendirmeyi amaçlar. Temel amacı benzer parçaları bir arada tutmaya çalışmaktır. Bunun için metindeki her cümlenin embed edilmiş elemanlarını diğer tüm elemanlar ile karşılaştırıp benzerlerini gruplar.
Temel işlem adımları:
- Belgeleri ayraçlara göre ayırır.
- Her cümleyi embeding algoritmasından geçirerek vektör uzayına yerleştirir.
- Chunklarda kaç cümle olacağı belirlenir. (Gruplar)
- Chunklar arasındaki mesafe hesaplanır.
- Benzerliklere göre chunklar birleştirilir.
- Benzer olmayan cümleler bölünür.
Yapılan işlem uygulamanın sonuçlarının başarısını arttırsada, chunklar vektör db’de depolandığı için önceki parçalama stratejilerine kıyasla ~5 kat daha yavaş çalışır.
from langchain_experimental.text_splitter import SemanticChunker
from langchain_openai.embeddings import OpenAIEmbeddings
import os
# Add OpenAI API key
os.environ["OPENAI_API_KEY"] = "**"
text_splitter = SemanticChunker(OpenAIEmbeddings(), breakpoint_threshold_type="standard_deviation")
# breakpoint_threshold_type="interquartile"
# breakpoint_threshold_type="percentile"
semantic_chunk= text_splitter.create_documents([text])
semantic_chunk
Metni parçalamak için Yüzdelik, Çeyreklik ve Standart Sapma eşik değeleri kullanılabilir.
- Yüzdelik eşik değeri varsayılan bölme yöntemidir. Bu yöntemde, cümleler arasındaki tüm farklar hesaplanır ve ardından X yüzdelik değerinden büyük olan tüm farklar bölünür.
- Çeyreklik eşik değeri ile çeyrekler arası uzaklıklar kullanılarak bölünür.
- Standart sapma eşik değeri ile standart sapmadan büyük olan farklar bölünür.
Sonuç
Chunking metotları uygulamanın sonucunu optimize edebilmek için oldukça önemlidir. Fakat her metot her problem için uygun olmayabilir. Bu noktada LLM uygulama geliştiricisi olarak probleme en uygun metodu seçmeniz oldukça önemlidir.
- Cümlelerin yarıda kesilmesinin anlamsal açıdan problem yaratmayacağı durumlarda hızlı sonuç almak için Sabit Boyutlu Chunking metotları seçilebilir.
- Cümleler yarıda kesilmesin ama hızlı olsun promptlar yardımı ile çözerim derseniz Recursive Chunking metotları seçilebilir.
- Dökümanlar belirli şartlara göre ayrılsın (Başlık, alt başlık, içerik gibi) anlamsal bütünlükten kopmasın ama yüzde yüz anlamsal ayrışmasa da hızlı çalışsın derseniz Document Specific Chunking metotları seçilebilir.
- Anlamsal ayrıntılar çok önemli bu yüzden sonuçlar mükemmel çıkmalı hız önemli değil derseniz Semantic Chunking metotları seçilebilir.