Created
May 12, 2025 09:12
-
-
Save pulipulichen/e967e184d524ee6968b928b86f6eb6c8 to your computer and use it in GitHub Desktop.
Dify,Docker,Reranker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
看看網頁版全文 ⇨ 自行架設Dify使用的重排序模型:Text Embeddings Inference : Self-Hosting a Dify Reranking Model: Text Embeddings Inference | |
https://blog.pulipuli.info/2025/05/selfhosting-a-dify-reranking-model-text-embeddings-inference.html | |
隨著在Dify使用的知識庫越來越多,傳統的用相似度來計算權重分數的做法已經不敷使用,而使用重排序模型來排序檢索結果順序的做法也越來越受歡迎。 | |
這次我們來架設HuggingFace推出的Text Embeddings Inference,並讓Dify能用它來做重排序吧。 | |
As the knowledge base used in Dify grows, the traditional method of calculating weight scores based on similarity is becoming inadequate. Using reranking models to reorder retrieval results is gaining popularity. Let's set up HuggingFace's Text Embeddings Inference and integrate it into Dify for reranking.。 | |
---- | |
# 重排序模型 / Rerank Model。 | |
https://docs.dify.ai/learn-more/extended-reading/retrieval-augment/rerank。 | |
重排序模型,有時稱為 Rerank Model 、 Reranking Model,以下則稱之為 Reranker,這是一種用於提升資訊檢索系統效能的模型。 | |
在檢索增強生成 (Retrieval-augmented generation, RAG ) 的過程中,文字被嵌入模型 (Embedding Model)轉換為語意向量,而檢索回來的結果會依照查詢語句跟檢索結果的語意向量來進行餘弦相似度的計算,以此來進行結果的排序。 | |
然而,上述的排序方式僅限於查詢語句跟檢索結果本身,往往無法考慮到背後的情境脈絡。 | |
這時候 Reranker 擁有深度學習模型的知識就能彌補這個缺憾。 | |
Reranker的運作分成兩個階段進行:。 | |
1. 初始檢索:檢索系統運用傳統的資訊檢索技術,例如BM25、TF-IDF或是向量的餘弦相似度,從大量文件中找到跟查詢語句相關的文件。至此跟傳統資訊檢索的做法很類似。 | |
---- | |
繼續閱讀 ⇨ 自行架設Dify使用的重排序模型:Text Embeddings Inference : Self-Hosting a Dify Reranking Model: Text Embeddings Inference | |
https://blog.pulipuli.info/2025/05/selfhosting-a-dify-reranking-model-text-embeddings-inference.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment