langchain/docs/extras/modules/data_connection
German Martin 3ce4e46c8c
The Fellowship of the Vectors: New Embeddings Filter using clustering. (#7015)
Continuing with Tolkien inspired series of langchain tools. I bring to
you:
**The Fellowship of the Vectors**, AKA EmbeddingsClusteringFilter.
This document filter uses embeddings to group vectors together into
clusters, then allows you to pick an arbitrary number of documents
vector based on proximity to the cluster centers. That's a
representative sample of the cluster.

The original idea is from [Greg Kamradt](https://github.com/gkamradt)
from this video (Level4):
https://www.youtube.com/watch?v=qaPMdcCqtWk&t=365s

I added few tricks to make it a bit more versatile, so you can
parametrize what to do with duplicate documents in case of cluster
overlap: replace the duplicates with the next closest document or remove
it. This allow you to use it as an special kind of redundant filter too.
Additionally you can choose 2 diff orders: grouped by cluster or
respecting the original retriever scores.
In my use case I was using the docs grouped by cluster to run refine
chains per cluster to generate summarization over a large corpus of
documents.
Let me know if you want to change anything!

@rlancemartin, @eyurtsev, @hwchase17,

---------

Co-authored-by: rlm <pexpresss31@gmail.com>
2023-07-07 10:28:17 -07:00
..
document_loaders/integrations Document loader for Cube Semantic Layer (#6882) 2023-07-05 15:18:12 -07:00
document_transformers/text_splitters MD header text splitter returns Documents (#6571) 2023-06-22 09:25:38 -07:00
retrievers The Fellowship of the Vectors: New Embeddings Filter using clustering. (#7015) 2023-07-07 10:28:17 -07:00
text_embedding/integrations Bagatur/clarifai update (#7324) 2023-07-07 02:23:20 -04:00
vectorstores/integrations Marqo Vector Store Examples & Type Hints (#7326) 2023-07-07 04:11:20 -04:00