Home / Function/ __init__() — langchain Function Reference

__init__() — langchain Function Reference

Architecture documentation for the __init__() function in spacy.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  b97103dd_3435_6e75_ebf0_2a8bcab7173c["__init__()"]
  f70dde90_12ee_c4f8_5e48_48f30085deb1["SpacyTextSplitter"]
  b97103dd_3435_6e75_ebf0_2a8bcab7173c -->|defined in| f70dde90_12ee_c4f8_5e48_48f30085deb1
  c5eb5b29_e38c_da31_1213_9cde1588ccb1["_make_spacy_pipeline_for_splitting()"]
  b97103dd_3435_6e75_ebf0_2a8bcab7173c -->|calls| c5eb5b29_e38c_da31_1213_9cde1588ccb1
  style b97103dd_3435_6e75_ebf0_2a8bcab7173c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/langchain_text_splitters/spacy.py lines 35–50

    def __init__(
        self,
        separator: str = "\n\n",
        pipeline: str = "en_core_web_sm",
        max_length: int = 1_000_000,
        *,
        strip_whitespace: bool = True,
        **kwargs: Any,
    ) -> None:
        """Initialize the spacy text splitter."""
        super().__init__(**kwargs)
        self._tokenizer = _make_spacy_pipeline_for_splitting(
            pipeline, max_length=max_length
        )
        self._separator = separator
        self._strip_whitespace = strip_whitespace

Subdomains

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the langchain codebase, defined in libs/text-splitters/langchain_text_splitters/spacy.py.
Where is __init__() defined?
__init__() is defined in libs/text-splitters/langchain_text_splitters/spacy.py at line 35.
What does __init__() call?
__init__() calls 1 function(s): _make_spacy_pipeline_for_splitting.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free