langchain/docs/modules/indexes
felpigeon 2791a753bf
Add start index to metadata in TextSplitter (#5912)
<!--
Thank you for contributing to LangChain! Your PR will appear in our
release under the title you set. Please make sure it highlights your
valuable contribution.

Replace this with a description of the change, the issue it fixes (if
applicable), and relevant context. List any dependencies required for
this change.

After you're done, someone will review your PR. They may suggest
improvements. If no one reviews your PR within a few days, feel free to
@-mention the same people again, as notifications can get lost.

Finally, we'd love to show appreciation for your contribution - if you'd
like us to shout you out on Twitter, please also include your handle!
-->

#### Add start index to metadata in TextSplitter

- Modified method `create_documents` to track start position of each
chunk
- The `start_index` is included in the metadata if the `add_start_index`
parameter in the class constructor is set to `True`

This enables referencing back to the original document, particularly
useful when a specific chunk is retrieved.

<!-- If you're adding a new integration, please include:

1. a test for the integration - favor unit tests that does not rely on
network access.
2. an example notebook showing its use


See contribution guidelines for more information on how to write tests,
lint
etc:


https://github.com/hwchase17/langchain/blob/master/.github/CONTRIBUTING.md
-->

#### Who can review?

Tag maintainers/contributors who might be interested:
@eyurtsev @agola11
<!-- For a quicker response, figure out the right person to tag with @

  @hwchase17 - project lead

  Tracing / Callbacks
  - @agola11

  Async
  - @agola11

  DataLoaders
  - @eyurtsev

  Models
  - @hwchase17
  - @agola11

  Agents / Tools / Toolkits
  - @vowelparrot

  VectorStores / Retrievers / Memory
  - @dev2049

 -->
2023-06-08 23:09:32 -07:00
..
document_loaders/examples Create snowflake Loader (#5825) 2023-06-08 22:03:00 -07:00
retrievers/examples Feature/add AWS Kendra Index Retriever (#5856) 2023-06-08 15:44:09 -07:00
text_splitters Add start index to metadata in TextSplitter (#5912) 2023-06-08 23:09:32 -07:00
vectorstores Added SingleStoreDB Vector Store (#5619) 2023-06-07 20:45:33 -07:00
document_loaders.rst fix ver 191 (#5784) 2023-06-06 09:17:23 -07:00
getting_started.ipynb Update getting_started.ipynb (#4850) 2023-05-17 13:19:14 -07:00
retrievers.rst
text_splitters.rst code splitter docs (#5480) 2023-05-31 07:11:53 -07:00
vectorstores.rst