Kevin Hu
commited on
Commit
·
badcb66
1
Parent(s):
f861b5e
Fix dify retrieval issue. (#4473)
Browse files### What problem does this PR solve?
#4464
#4469
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- api/apps/sdk/dify_retrieval.py +1 -1
- rag/app/manual.py +1 -1
api/apps/sdk/dify_retrieval.py
CHANGED
@@ -62,7 +62,7 @@ def retrieval(tenant_id):
|
|
62 |
for c in ranks["chunks"]:
|
63 |
c.pop("vector", None)
|
64 |
records.append({
|
65 |
-
"content": c["
|
66 |
"score": c["similarity"],
|
67 |
"title": c["docnm_kwd"],
|
68 |
"metadata": {}
|
|
|
62 |
for c in ranks["chunks"]:
|
63 |
c.pop("vector", None)
|
64 |
records.append({
|
65 |
+
"content": c["content_with_weight"],
|
66 |
"score": c["similarity"],
|
67 |
"title": c["docnm_kwd"],
|
68 |
"metadata": {}
|
rag/app/manual.py
CHANGED
@@ -70,7 +70,7 @@ class Pdf(PdfParser):
|
|
70 |
for b in self.boxes:
|
71 |
b["text"] = re.sub(r"([\t ]|\u3000){2,}", " ", b["text"].strip())
|
72 |
|
73 |
-
return [(b["text"], b.get("
|
74 |
for i, b in enumerate(self.boxes)], tbls
|
75 |
|
76 |
|
|
|
70 |
for b in self.boxes:
|
71 |
b["text"] = re.sub(r"([\t ]|\u3000){2,}", " ", b["text"].strip())
|
72 |
|
73 |
+
return [(b["text"], b.get("layoutno", ""), self.get_position(b, zoomin))
|
74 |
for i, b in enumerate(self.boxes)], tbls
|
75 |
|
76 |
|