langchain/docs
Evan Harris 61ea7bf60b
Add a ListRerank document compressor (#13311)
- **Description:** This PR adds a new document compressor called
`ListRerank`. It's derived from `BaseDocumentCompressor`. It's a near
exact implementation of introduced by this paper: [Zero-Shot Listwise
Document Reranking with a Large Language
Model](https://arxiv.org/pdf/2305.02156.pdf) which it finds to
outperform pointwise reranking, which is somewhat implemented in
LangChain as
[LLMChainFilter](https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/retrievers/document_compressors/chain_filter.py).
- **Issue:** None
- **Dependencies:** None
- **Tag maintainer:** @hwchase17 @izzymsft
- **Twitter handle:** @HarrisEMitchell

Notes:
1. I didn't add anything to `docs`. I wasn't exactly sure which patterns
to follow as [cohere reranker is under
Retrievers](https://python.langchain.com/docs/integrations/retrievers/cohere-reranker)
with other external document retrieval integrations, but other
contextual compression is
[here](https://python.langchain.com/docs/modules/data_connection/retrievers/contextual_compression/).
Happy to contribute to either with some direction.
2. I followed syntax, docstrings, implementation patterns, etc. as well
as I could looking at nearby modules. One thing I didn't do was put the
default prompt in a separate `.py` file like [Chain
Filter](https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/retrievers/document_compressors/chain_filter_prompt.py)
and [Chain
Extract](https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/retrievers/document_compressors/chain_extract_prompt.py).
Happy to follow that pattern if it would be preferred.

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-07-18 20:34:38 +00:00
..
api_reference docs: readthedocs deprecation fix (#24321) 2024-07-16 20:32:51 +00:00
data 👥 Update LangChain people data (#23697) 2024-07-01 17:42:55 +00:00
docs Add a ListRerank document compressor (#13311) 2024-07-18 20:34:38 +00:00
scripts docs[patch]: Remove deprecated Airbyte loaders from listings (#23927) 2024-07-10 02:21:25 +00:00
src docs: chain migration guide (#23844) 2024-07-05 16:37:34 -07:00
static docs[patch]: Update intro diagram (#24290) 2024-07-15 22:04:42 -07:00
.gitignore infra: cleanup docs build (#21134) 2024-05-01 17:34:05 -07:00
.yarnrc.yml docs[minor]: Add thumbs up/down to all docs pages (#18526) 2024-03-04 15:14:28 -08:00
babel.config.js Restructure docs (#11620) 2023-10-10 12:55:19 -07:00
docusaurus.config.js docs: rm discord (#23985) 2024-07-08 14:27:58 -07:00
ignore-step.sh infra: docs ignore step in script (#24090) 2024-07-10 15:18:00 -07:00
Makefile docs: remove couchbase from docs linking (#24277) 2024-07-15 17:34:41 +00:00
package.json docs[patch]: Adds feedback input after thumbs up/down (#23141) 2024-06-18 16:08:22 -07:00
README.md docs: developer docs (#14776) 2023-12-17 12:55:49 -08:00
sidebars.js docs[minor]: Hide langserve pages (#23618) 2024-06-28 08:25:08 -07:00
vercel_build.sh infra: use nbconvert for docs build (#21135) 2024-05-07 12:30:17 -07:00
vercel_requirements.txt package: security update urllib3 to @1.26.19 (#23366) 2024-06-24 19:44:39 +00:00
vercel.json infra: docs ignore step in script (#24090) 2024-07-10 15:18:00 -07:00
yarn.lock docs[patch]: Adds feedback input after thumbs up/down (#23141) 2024-06-18 16:08:22 -07:00

LangChain Documentation

For more information on contributing to our documentation, see the Documentation Contributing Guide