feat(memory): add emotion batch extraction task and improve extraction prompts
- Add extract_emotion_batch_task for async emotion extraction - Refine Chinese entity types and relation types in extraction prompts - Add STATEMENT_EMOTION_UPDATE Cypher query for Neo4j backfill - Refactor statement_step and triplet_step implementations
This commit is contained in:
@@ -46,6 +46,15 @@ SET s += {
|
||||
RETURN s.id AS uuid
|
||||
"""
|
||||
|
||||
STATEMENT_EMOTION_UPDATE = """
|
||||
UNWIND $items AS item
|
||||
MATCH (s:Statement {id: item.statement_id})
|
||||
SET s.emotion_type = item.emotion_type,
|
||||
s.emotion_intensity = item.emotion_intensity,
|
||||
s.emotion_keywords = item.emotion_keywords
|
||||
RETURN s.id AS uuid
|
||||
"""
|
||||
|
||||
CHUNK_NODE_SAVE = """
|
||||
UNWIND $chunks AS chunk
|
||||
MERGE (c:Chunk {id: chunk.id})
|
||||
|
||||
Reference in New Issue
Block a user