langchain/docs
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
..
api_reference rm side nav (#7297) 2023-07-06 15:19:29 -04:00
docs_skeleton Output parser redirect (#7330) 2023-07-07 04:26:34 -04:00
extras The Fellowship of the Vectors: New Embeddings Filter using clustering. (#7015) 2023-07-07 10:28:17 -07:00
snippets Use correct Language for html_splitter (#7274) 2023-07-06 09:24:25 -04:00
.local_build.sh Harrison/deeplake new features (#6263) 2023-06-16 17:53:55 -07:00
package-lock.json docs: New experimental UI for Mendable Search (#6558) 2023-07-03 20:52:13 +01:00
requirements.txt Page per class-style api reference (#6560) 2023-06-30 09:23:32 -07:00