infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
24.06k stars 2.35k forks source link

[Bug]: The value of vector_similarity returned by the api/v1/retrieval interface of ragflow is always 0 #3587

Open bewithme opened 6 days ago

bewithme commented 6 days ago

Is there an existing issue for the same bug?

RAGFlow workspace code commit ID

none

RAGFlow image version

infiniflow/ragflow:v0.13.0

Other environment information

Linux 10-60-207-244 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Actual behavior

this is request body `{ "question": "xxxxxxx", "dataset_ids": ["7b78e9aaa7e811ef84dc0242ac1b0006"], "page":1, "rerank_id": "gte-rerank@Tongyi-Qianwen", "similarity_threshold": 0.2, "size": 10, "top_k": 5, "vector_similarity_weight": 0.30000000000000004

}`

this is response body chunk {"code":0,"data":{"chunks":[{"content":"xxxxxxx","id":"bf9d0c25ec76ea0eea3f0eec3ce2b531","img_id":"7b78e9aaa7e811ef84dc0242ac1b0006-bf9d0c25ec76ea0eea3f0eec3ce2b531","important_keywords":[],"kb_id":"7b78e9aaa7e811ef84dc0242ac1b0006","positions":[[68.0,90.0,534.0,613.0,624.0],[68.0,89.0,533.0,629.0,736.0],[68.0,295.0,739.0,772.0,782.0],[69.0,267.0,711.0,171.0,185.0],[69.0,88.0,532.0,391.0,402.0],[69.0,90.0,534.0,748.0,759.0],[69.0,295.0,739.0,772.0,782.0],[70.0,88.0,532.0,78.0,842.0],[71.0,88.0,532.0,0.0,109.0],[70.0,295.0,739.0,772.0,782.0],[71.0,88.0,532.0,136.0,147.0],[71.0,88.0,532.0,152.0,164.0]],"similarity":0.6629022502370199,"term_similarity":0.9470032146243141,"vector_similarity":0.0},

Expected behavior

vector_similarity is not 0

Steps to reproduce

1.run  docker-compose -f docker-compose-gpu.yml up -d 

2.log in and create kb and upload file

3.call the interface "api/v1/retrieval" by python code

Additional information

No response

liwenju0 commented 6 days ago

可以检查一下rerank模型服务是不是出问题了。 如果rerank有问题,会返回0