77from .base import BaseTransform
88
99
10- class Text_Partition (BaseTransform ):
10+ class TextPartition (BaseTransform ):
1111 """Partitions PDF file into text elements."""
1212
1313 def __init__ (self ,
@@ -18,13 +18,14 @@ def __init__(self,
1818 ** kwargs ):
1919 """Initializes an PDFPartition object.
2020
21- Args:
22- chunking_strategy (str): Chunking strategy to use.
23- max_characters (int): Maximum number of characters in a chunk.
24- overlap (int): Number of characters to overlap between chunks.
25- overlap_all (bool): Whether to overlap all chunks.
26- kwargs: Additional keyword arguments.
27- """
21+ Args:
22+ chunking_strategy (str): Chunking strategy to use.
23+ max_characters (int): Maximum number of characters in a chunk.
24+ overlap (int): Number of characters to overlap between chunks.
25+ overlap_all (bool): Whether to overlap all chunks.
26+ kwargs: Additional keyword arguments.
27+
28+ """
2829 if chunking_strategy not in ["basic" , "by_title" ]:
2930 raise ValueError ("chunking_strategy should be either 'basic' or 'by_title'." )
3031 self .chunking_strategy = chunking_strategy
@@ -36,13 +37,13 @@ def __init__(self,
3637 def __call__ (self , elements : List [str ]) -> List [str ]:
3738 """Applies the transformation.
3839
39- Args:
40- elements (List[str]): List of text elements.
40+ Args:
41+ elements (List[str]): List of text elements.
4142
42- Returns:
43- List of transformed text elements.
43+ Returns:
44+ List of transformed text elements.
4445
45- """
46+ """
4647 file_elements = []
4748 for filename in elements :
4849 file_element = partition_text (
0 commit comments