mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Revert "Fix: forwarding highlight param" (#14249)
Reverts infiniflow/ragflow#14112
This commit is contained in:
@@ -498,15 +498,6 @@ async def retrieval_test():
|
||||
_question += await keyword_extraction(chat_mdl, _question)
|
||||
|
||||
labels = label_question(_question, [kb])
|
||||
highlight_val = req.get("highlight", None)
|
||||
if highlight_val is None:
|
||||
highlight = False
|
||||
elif isinstance(highlight_val, bool):
|
||||
highlight = highlight_val
|
||||
elif isinstance(highlight_val, str):
|
||||
highlight = highlight_val.lower() in ("true", "1", "yes", "on")
|
||||
else:
|
||||
highlight = bool(highlight_val)
|
||||
ranks = await settings.retriever.retrieval(
|
||||
_question,
|
||||
embd_mdl,
|
||||
@@ -519,7 +510,6 @@ async def retrieval_test():
|
||||
doc_ids=local_doc_ids,
|
||||
top=top,
|
||||
rerank_mdl=rerank_mdl,
|
||||
highlight=highlight,
|
||||
rank_feature=labels
|
||||
)
|
||||
|
||||
|
||||
@@ -654,7 +654,6 @@ class Dealer:
|
||||
chunk = self.dataStore.get(cid, idx_nms[0], kb_ids)
|
||||
if not chunk:
|
||||
continue
|
||||
has_highlights = any(ck.get("highlight") for ck in chunks)
|
||||
d = {
|
||||
"chunk_id": cid,
|
||||
"content_ltks": chunk["content_ltks"],
|
||||
@@ -671,8 +670,6 @@ class Dealer:
|
||||
"positions": chunk.get("position_int", []),
|
||||
"doc_type_kwd": chunk.get("doc_type_kwd", "")
|
||||
}
|
||||
if has_highlights:
|
||||
d["highlight"] = chunk["content_with_weight"]
|
||||
for k in chunk.keys():
|
||||
if k[-4:] == "_vec":
|
||||
d["vector"] = chunk[k]
|
||||
@@ -705,7 +702,6 @@ class Dealer:
|
||||
vector_size = 1024
|
||||
for id, cks in mom_chunks.items():
|
||||
chunk = self.dataStore.get(id, idx_nms[0], [ck["kb_id"] for ck in cks])
|
||||
child_highlights = [ck["highlight"] for ck in cks if ck.get("highlight")]
|
||||
d = {
|
||||
"chunk_id": id,
|
||||
"content_ltks": " ".join([ck["content_ltks"] for ck in cks]),
|
||||
@@ -722,8 +718,6 @@ class Dealer:
|
||||
"positions": chunk.get("position_int", []),
|
||||
"doc_type_kwd": chunk.get("doc_type_kwd", "")
|
||||
}
|
||||
if child_highlights:
|
||||
d["highlight"] = " ".join(child_highlights)
|
||||
for k in cks[0].keys():
|
||||
if k[-4:] == "_vec":
|
||||
d["vector"] = cks[0][k]
|
||||
|
||||
@@ -265,8 +265,8 @@ class TestChunksRetrieval:
|
||||
@pytest.mark.parametrize(
|
||||
"payload, expected_code, expected_highlight, expected_message",
|
||||
[
|
||||
({"highlight": True}, 0, True, ""),
|
||||
({"highlight": "True"}, 0, True, ""),
|
||||
pytest.param({"highlight": True}, 0, True, "", marks=pytest.mark.skip(reason="highlight not functionnal")),
|
||||
pytest.param({"highlight": "True"}, 0, True, "", marks=pytest.mark.skip(reason="highlight not functionnal")),
|
||||
({"highlight": False}, 0, False, ""),
|
||||
({"highlight": "False"}, 0, False, ""),
|
||||
({"highlight": None}, 0, False, "")
|
||||
|
||||
@@ -622,7 +622,6 @@ export const useTestChunkRetrieval = (): ResponsePostType<ITestingResult> & {
|
||||
const { data } = await kbService.retrievalTest({
|
||||
...values,
|
||||
kb_id: values.kb_id ?? knowledgeBaseId,
|
||||
highlight: true,
|
||||
page,
|
||||
size: pageSize,
|
||||
});
|
||||
@@ -667,7 +666,6 @@ export const useTestChunkAllRetrieval = (): ResponsePostType<ITestingResult> & {
|
||||
const { data } = await kbService.retrievalTest({
|
||||
...values,
|
||||
kb_id: values.kb_id ?? knowledgeBaseId,
|
||||
highlight: true,
|
||||
doc_ids: [],
|
||||
page,
|
||||
size: pageSize,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
.chunkText() {
|
||||
em {
|
||||
color: rgb(var(--accent-primary));
|
||||
color: var(--accent-primary);
|
||||
font-style: normal;
|
||||
}
|
||||
table {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { EmptyType } from '@/components/empty/constant';
|
||||
import Empty from '@/components/empty/empty';
|
||||
import HighLightMarkdown from '@/components/highlight-markdown';
|
||||
import { FilterButton } from '@/components/list-filter-bar';
|
||||
import { FilterPopover } from '@/components/list-filter-bar/filter-popover';
|
||||
import { FilterCollection } from '@/components/list-filter-bar/interface';
|
||||
@@ -92,11 +91,7 @@ export function TestingResult({
|
||||
<article key={x.chunk_id}>
|
||||
<Card className="px-5 py-2.5 bg-transparent shadow-none">
|
||||
<ChunkTitle item={x}></ChunkTitle>
|
||||
<div className="!mt-2.5">
|
||||
<HighLightMarkdown>
|
||||
{x.highlight || x.content_with_weight}
|
||||
</HighLightMarkdown>
|
||||
</div>
|
||||
<p className="!mt-2.5"> {x.content_with_weight}</p>
|
||||
</Card>
|
||||
</article>
|
||||
))}
|
||||
|
||||
@@ -205,7 +205,7 @@ export default function SearchingView({
|
||||
></ImageWithPopover>
|
||||
)}
|
||||
<HighLightMarkdown>
|
||||
{chunk.highlight || chunk.content_with_weight}
|
||||
{chunk.content_with_weight}
|
||||
</HighLightMarkdown>
|
||||
</div>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user