feat(web): memoryExtractionEngine add pruning
This commit is contained in:
@@ -1640,6 +1640,10 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re
|
|||||||
scene_type_distribution: 'Scene Type Distribution',
|
scene_type_distribution: 'Scene Type Distribution',
|
||||||
general_type_distribution: 'General Type Distribution',
|
general_type_distribution: 'General Type Distribution',
|
||||||
unmatched: 'Unmatched',
|
unmatched: 'Unmatched',
|
||||||
|
disagreementCase: 'Disagreement Case',
|
||||||
|
Pruned: 'Pruned',
|
||||||
|
pruning: 'Pruning',
|
||||||
|
pruning_desc: 'Text pruning {{count}} fragments'
|
||||||
},
|
},
|
||||||
memoryConversation: {
|
memoryConversation: {
|
||||||
searchPlaceholder: 'Enter user ID...',
|
searchPlaceholder: 'Enter user ID...',
|
||||||
|
|||||||
@@ -1637,6 +1637,10 @@ export const zh = {
|
|||||||
scene_type_distribution: '场景类型',
|
scene_type_distribution: '场景类型',
|
||||||
general_type_distribution: '通用类型',
|
general_type_distribution: '通用类型',
|
||||||
unmatched: '未匹配',
|
unmatched: '未匹配',
|
||||||
|
disagreementCase: '不一致案例',
|
||||||
|
Pruned: '已剪枝',
|
||||||
|
pruning: '剪枝',
|
||||||
|
pruning_desc: '文本剪枝{{count}}个片段'
|
||||||
},
|
},
|
||||||
memoryConversation: {
|
memoryConversation: {
|
||||||
chatEmpty:'有什么我可以帮您的吗?',
|
chatEmpty:'有什么我可以帮您的吗?',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 17:30:11
|
* @Date: 2026-02-03 17:30:11
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-02-09 21:04:14
|
* @Last Modified time: 2026-03-02 11:41:12
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Result Component
|
* Result Component
|
||||||
@@ -104,7 +104,7 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
|
|||||||
case 'text_preprocessing_result': // Text preprocessing in progress
|
case 'text_preprocessing_result': // Text preprocessing in progress
|
||||||
setTextPreprocessing(prev => ({
|
setTextPreprocessing(prev => ({
|
||||||
...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
|
break
|
||||||
case 'text_preprocessing_complete': // Text preprocessing complete
|
case 'text_preprocessing_complete': // Text preprocessing complete
|
||||||
@@ -266,14 +266,27 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
|
|||||||
headerType="borderL"
|
headerType="borderL"
|
||||||
headerClassName="rb:before:bg-[#155EEF]!"
|
headerClassName="rb:before:bg-[#155EEF]!"
|
||||||
>
|
>
|
||||||
{textPreprocessing.data.map((vo, index) => (
|
{textPreprocessing.data.map((vo, index) => {
|
||||||
|
if (vo.deleted_messages) {
|
||||||
|
return <div key={index} className="rb:mb-3 rb:pb-1 rb:border-b rb:border-b-[#EBEBEB]">
|
||||||
|
<div className="rb:font-medium rb:text-[12px] rb:mb-2">{t('memoryExtractionEngine.Pruned')}</div>
|
||||||
|
{vo.deleted_messages.map((msg: any, idx: number) => (
|
||||||
|
<div key={idx} className="rb:text-[12px] rb:text-[#5B6167] rb:leading-4 rb:font-regular">
|
||||||
|
<Markdown content={'-' + t('memoryExtractionEngine.pruning') + (idx + 1) + ': ' + msg.content} />
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
return (
|
||||||
<div key={index} className="rb:mb-3 rb:text-[12px] rb:text-[#5B6167] rb:leading-4 rb:font-regular">
|
<div key={index} className="rb:mb-3 rb:text-[12px] rb:text-[#5B6167] rb:leading-4 rb:font-regular">
|
||||||
<Markdown content={'-' + t('memoryExtractionEngine.fragment') + vo.chunk_index + ': ' + (vo.content.startsWith('\n') ? vo.content : '\n' + vo.content)} />
|
<Markdown content={'-' + t('memoryExtractionEngine.fragment') + vo.chunk_index + ': ' + (vo.content.startsWith('\n') ? vo.content : '\n' + vo.content)} />
|
||||||
</div>
|
</div>
|
||||||
))}
|
)
|
||||||
|
})}
|
||||||
{formatTime(textPreprocessing)}
|
{formatTime(textPreprocessing)}
|
||||||
{textPreprocessing.result &&
|
{textPreprocessing.result &&
|
||||||
<RbAlert color="blue" icon={<CheckCircleFilled />} className="rb:mt-3">
|
<RbAlert color="blue" icon={<CheckCircleFilled />} className="rb:mt-3">
|
||||||
|
{t('memoryExtractionEngine.pruning_desc', { count: textPreprocessing.result.pruning.deleted_count || 0 })},
|
||||||
{t('memoryExtractionEngine.text_preprocessing_desc', { count: textPreprocessing.result.total_chunks })},
|
{t('memoryExtractionEngine.text_preprocessing_desc', { count: textPreprocessing.result.total_chunks })},
|
||||||
{t('memoryExtractionEngine.chunkerStrategy')}: {t(`memoryExtractionEngine.${lowercaseFirst(textPreprocessing.result.chunker_strategy)}`)}
|
{t('memoryExtractionEngine.chunkerStrategy')}: {t(`memoryExtractionEngine.${lowercaseFirst(textPreprocessing.result.chunker_strategy)}`)}
|
||||||
</RbAlert>
|
</RbAlert>
|
||||||
@@ -349,7 +362,6 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
|
|||||||
<div className="rb:text-[24px] rb:leading-7.5 rb:font-extrabold">{(testResult?.[keys[0] as keyof TestResult] as any)?.[keys[1]]}</div>
|
<div className="rb:text-[24px] rb:leading-7.5 rb:font-extrabold">{(testResult?.[keys[0] as keyof TestResult] as any)?.[keys[1]]}</div>
|
||||||
<div className="rb:text-[12px] rb:text-[#5B6167] rb:leading-4 rb:font-regular">{t(`memoryExtractionEngine.${key}`)}</div>
|
<div className="rb:text-[12px] rb:text-[#5B6167] rb:leading-4 rb:font-regular">{t(`memoryExtractionEngine.${key}`)}</div>
|
||||||
<div className="rb:mt-1 rb:text-[12px] rb:text-[#369F21] rb:leading-3.5 rb:font-regular">
|
<div className="rb:mt-1 rb:text-[12px] rb:text-[#369F21] rb:leading-3.5 rb:font-regular">
|
||||||
{}
|
|
||||||
{key === 'extractTheNumberOfEntities' && testResult.dedup
|
{key === 'extractTheNumberOfEntities' && testResult.dedup
|
||||||
? t(`memoryExtractionEngine.${key}Desc`, {
|
? t(`memoryExtractionEngine.${key}Desc`, {
|
||||||
num: testResult.dedup.total_merged_count,
|
num: testResult.dedup.total_merged_count,
|
||||||
@@ -399,7 +411,7 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
|
|||||||
<div key={index} className={clsx("rb:text-[12px] rb:text-[#5B6167] rb:leading-4", {
|
<div key={index} className={clsx("rb:text-[12px] rb:text-[#5B6167] rb:leading-4", {
|
||||||
'rb:mt-4': index > 0,
|
'rb:mt-4': index > 0,
|
||||||
})}>
|
})}>
|
||||||
<div className="rb:font-medium rb:mb-2">Disagreement Case {index +1}:</div>
|
<div className="rb:font-medium rb:mb-2">{t('memoryExtractionEngine.disagreementCase')} {index +1}:</div>
|
||||||
-{item.left.name}({item.left.type}) vs {item.right.name}({item.right.type}) → <span className="rb:text-[#369F21]">{item.result}</span>
|
-{item.left.name}({item.left.type}) vs {item.right.name}({item.right.type}) → <span className="rb:text-[#369F21]">{item.result}</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user