diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index fdbde290..02add0ec 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1640,6 +1640,10 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re scene_type_distribution: 'Scene Type Distribution', general_type_distribution: 'General Type Distribution', unmatched: 'Unmatched', + disagreementCase: 'Disagreement Case', + Pruned: 'Pruned', + pruning: 'Pruning', + pruning_desc: 'Text pruning {{count}} fragments' }, memoryConversation: { searchPlaceholder: 'Enter user ID...', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index c855667f..06abf63a 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -1637,6 +1637,10 @@ export const zh = { scene_type_distribution: '场景类型', general_type_distribution: '通用类型', unmatched: '未匹配', + disagreementCase: '不一致案例', + Pruned: '已剪枝', + pruning: '剪枝', + pruning_desc: '文本剪枝{{count}}个片段' }, memoryConversation: { chatEmpty:'有什么我可以帮您的吗?', diff --git a/web/src/views/MemoryExtractionEngine/components/Result.tsx b/web/src/views/MemoryExtractionEngine/components/Result.tsx index 68ff397b..6504f571 100644 --- a/web/src/views/MemoryExtractionEngine/components/Result.tsx +++ b/web/src/views/MemoryExtractionEngine/components/Result.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 17:30:11 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-09 21:04:14 + * @Last Modified time: 2026-03-02 11:41:12 */ /** * Result Component @@ -91,7 +91,7 @@ const Result: FC = ({ loading, handleSave }) => { setDeduplication({...initObj} as ModuleItem) setTestResult({} as TestResult) const handleStreamMessage = (list: SSEMessage[]) => { - + list.forEach((data: AnyObject) => { switch(data.event) { case 'text_preprocessing': // Start text preprocessing @@ -104,7 +104,7 @@ const Result: FC = ({ loading, handleSave }) => { case 'text_preprocessing_result': // Text preprocessing in progress setTextPreprocessing(prev => ({ ...prev, - data: [...prev.data, data.data?.data] + data: [...prev.data, data.data?.deleted_messages ? { deleted_messages: data.data?.deleted_messages } : data.data?.data], })) break case 'text_preprocessing_complete': // Text preprocessing complete @@ -193,9 +193,9 @@ const Result: FC = ({ loading, handleSave }) => { dialogue_text: t('memoryExtractionEngine.exampleText'), custom_text: runForm.getFieldValue('custom_text') }, handleStreamMessage) - .finally(() => { - setRunLoading(false) - }) + .finally(() => { + setRunLoading(false) + }) } const completedNum = [textPreprocessing, knowledgeExtraction, creatingNodesEdges, deduplication].filter(item => item.status === 'completed').length const deduplicationData = groupDataByType(deduplication.data, 'result_type') @@ -251,10 +251,10 @@ const Result: FC = ({ loading, handleSave }) => { : !testResult || Object.keys(testResult).length === 0 - ? } className="rb:mb-3.5"> - {t('memoryExtractionEngine.warning')} - - : } className="rb:mb-3.5"> + ? } className="rb:mb-3.5"> + {t('memoryExtractionEngine.warning')} + + : } className="rb:mb-3.5"> {t('memoryExtractionEngine.success')} } @@ -266,15 +266,28 @@ const Result: FC = ({ loading, handleSave }) => { headerType="borderL" headerClassName="rb:before:bg-[#155EEF]!" > - {textPreprocessing.data.map((vo, index) => ( -
- -
- ))} + {textPreprocessing.data.map((vo, index) => { + if (vo.deleted_messages) { + return
+
{t('memoryExtractionEngine.Pruned')}
+ {vo.deleted_messages.map((msg: any, idx: number) => ( +
+ +
+ ))} +
+ } + return ( +
+ +
+ ) + })} {formatTime(textPreprocessing)} {textPreprocessing.result && } className="rb:mt-3"> - {t('memoryExtractionEngine.text_preprocessing_desc', { count: textPreprocessing.result.total_chunks })}, + {t('memoryExtractionEngine.pruning_desc', { count: textPreprocessing.result.pruning.deleted_count || 0 })}, + {t('memoryExtractionEngine.text_preprocessing_desc', { count: textPreprocessing.result.total_chunks })}, {t('memoryExtractionEngine.chunkerStrategy')}: {t(`memoryExtractionEngine.${lowercaseFirst(textPreprocessing.result.chunker_strategy)}`)} } @@ -286,7 +299,7 @@ const Result: FC = ({ loading, handleSave }) => { headerType="borderL" headerClassName="rb:before:bg-[#155EEF]!" > - {knowledgeExtraction.data.map((vo, index) => + {knowledgeExtraction.data.map((vo, index) =>
{vo.statement}
)} {formatTime(knowledgeExtraction)} @@ -345,31 +358,30 @@ const Result: FC = ({ loading, handleSave }) => { {Object.keys(resultObj).map((key, index) => { const keys = (resultObj as Record)[key].split('.') return ( -
-
{(testResult?.[keys[0] as keyof TestResult] as any)?.[keys[1]]}
-
{t(`memoryExtractionEngine.${key}`)}
-
- {} - {key === 'extractTheNumberOfEntities' && testResult.dedup - ? t(`memoryExtractionEngine.${key}Desc`, { - num: testResult.dedup.total_merged_count, - exact: testResult.dedup.breakdown.exact, - fuzzy: testResult.dedup.breakdown.fuzzy, - llm: testResult.dedup.breakdown.llm, - }) - : key === 'numberOfEntityDisambiguation' && testResult.disambiguation - ? t(`memoryExtractionEngine.${key}Desc`, { num: testResult.disambiguation.effects?.length, block_count: testResult.disambiguation.block_count }) - : key === 'numberOfRelationalTriples' && testResult.triplets - ? t(`memoryExtractionEngine.${key}Desc`, { num: testResult.triplets.count }) - :t(`memoryExtractionEngine.${key}Desc`) - } +
+
{(testResult?.[keys[0] as keyof TestResult] as any)?.[keys[1]]}
+
{t(`memoryExtractionEngine.${key}`)}
+
+ {key === 'extractTheNumberOfEntities' && testResult.dedup + ? t(`memoryExtractionEngine.${key}Desc`, { + num: testResult.dedup.total_merged_count, + exact: testResult.dedup.breakdown.exact, + fuzzy: testResult.dedup.breakdown.fuzzy, + llm: testResult.dedup.breakdown.llm, + }) + : key === 'numberOfEntityDisambiguation' && testResult.disambiguation + ? t(`memoryExtractionEngine.${key}Desc`, { num: testResult.disambiguation.effects?.length, block_count: testResult.disambiguation.block_count }) + : key === 'numberOfRelationalTriples' && testResult.triplets + ? t(`memoryExtractionEngine.${key}Desc`, { num: testResult.triplets.count }) + :t(`memoryExtractionEngine.${key}Desc`) + } +
-
- )})} + )})}
} - + {testResult?.dedup?.impact && testResult.dedup.impact?.length > 0 && = ({ loading, handleSave }) => {
} - + {testResult?.disambiguation && testResult.disambiguation?.effects?.length > 0 && = ({ loading, handleSave }) => {
0, })}> -
Disagreement Case {index +1}:
+
{t('memoryExtractionEngine.disagreementCase')} {index +1}:
-{item.left.name}({item.left.type}) vs {item.right.name}({item.right.type}) → {item.result}
))} @@ -409,7 +421,7 @@ const Result: FC = ({ loading, handleSave }) => {
} - + {testResult?.core_entities && testResult?.core_entities.length > 0 && = ({ loading, handleSave }) => { } - + {testResult?.triplet_samples && testResult?.triplet_samples.length > 0 &&