-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchunker_cpp.pyi
More file actions
100 lines (85 loc) · 3.02 KB
/
chunker_cpp.pyi
File metadata and controls
100 lines (85 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"""
File: /chunker_cpp.pyi
Created Date: Thursday September 18th 2025
Author: Christian Nonis <alch.infoemail@gmail.com>
-----
Last Modified: Thursday September 18th 2025 9:38:02 pm
Modified By: the developer formerly known as Christian Nonis at <alch.infoemail@gmail.com>
-----
"""
from typing import List, Dict, Any, Union
class SemanticTextChunker:
"""Advanced semantic text chunking class that preserves meaning and context."""
def __init__(self) -> None:
"""Initialize the semantic text chunker."""
...
def chunk_text_semantically(
self,
text: str,
max_chunk_size: int = 2000,
min_chunk_size: int = 500,
min_coherence_threshold: float = 0.3,
) -> List[str]:
"""
Chunk text semantically while preserving meaning and context.
Args:
text: The input text to be chunked
max_chunk_size: Maximum size for each chunk (default: 2000)
min_chunk_size: Minimum size for each chunk (default: 500)
min_coherence_threshold: Minimum coherence threshold (default: 0.3)
Returns:
List of text chunks
"""
...
def get_chunk_details(
self,
text: str,
max_chunk_size: int = 2000,
min_chunk_size: int = 500,
min_coherence_threshold: float = 0.3,
) -> List[Dict[str, Any]]:
"""
Get detailed information about each chunk including coherence scores and topics.
Args:
text: The input text to be chunked
max_chunk_size: Maximum size for each chunk (default: 2000)
min_chunk_size: Minimum size for each chunk (default: 500)
min_coherence_threshold: Minimum coherence threshold (default: 0.3)
Returns:
List of dictionaries containing chunk details
"""
...
def chunk_text_semantically(
text: str,
max_chunk_size: int = 2000,
min_chunk_size: int = 500,
min_coherence_threshold: float = 0.3,
) -> List[str]:
"""
Chunk text semantically while preserving meaning and context (standalone function).
Args:
text: The input text to be chunked
max_chunk_size: Maximum size for each chunk (default: 2000)
min_chunk_size: Minimum size for each chunk (default: 500)
min_coherence_threshold: Minimum coherence threshold (default: 0.3)
Returns:
List of text chunks
"""
...
def get_chunk_details(
text: str,
max_chunk_size: int = 2000,
min_chunk_size: int = 500,
min_coherence_threshold: float = 0.3,
) -> List[Dict[str, Any]]:
"""
Get detailed information about each chunk including coherence scores and topics (standalone function).
Args:
text: The input text to be chunked
max_chunk_size: Maximum size for each chunk (default: 2000)
min_chunk_size: Minimum size for each chunk (default: 500)
min_coherence_threshold: Minimum coherence threshold (default: 0.3)
Returns:
List of dictionaries containing chunk details
"""
...