Views
No views yet
1from fine_chunker import Chunker
2
3# Load the model (runs optimally on CUDA or CPU)
4chunker = Chunker.from_pretrained(device="cpu", use_onnx=True)
5
6text = "Your long multi-topic document..."
7chunks = chunker.chunk(text)
8
9for chunk in chunks:
10 print(f"Index: {chunk.index} | Content: {chunk.content[:100]}...")\n\n) found in well-structured Wikipedia articles.8192 token sequences to maximize training efficiency.bfloat16 with Flash Attention 2.[1.0, 7.0]) to address boundary sparsity.Linear(hidden_size, hidden_size)ReLUDropout(0.1)Linear(hidden_size, 2) (Boundary vs. Non-boundary)fine-chunker library in your research or project, please cite it as follows:1@misc{boksa2026modernbertchunker,
2 author = {Jerzy Boksa},
3 title = {ModernBERT Chunker Base: Specialized Semantic Boundary Detection for RAG},
4 year = {2026},
5 publisher = {Hugging Face},
6 journal = {Hugging Face Model Hub},
7 howpublished = {\url{https://huggingface.co/jboksa/modbert-chunker-base}}
8}