Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

How can we improve the accuracy of extracting character relationships from literature?

2025-08-19 506

提升文学作品分析准确率的关键方法:

  1. Refinement Cue Words:明确指令如"Extract characters, emotions, and relationships in order of appearance..."要求严格按出现顺序提取
  2. 增加示例数量: inexamples参数中添加更多带标注的文本片段
  3. 使用高质量模型:文学分析推荐gemini-2.5-promould
  4. Post-processing validation:通过生成HTML可视化文件人工校验visualization.html

典型实现代码:

# 定义提示词+示例
examples = [lx.data.ExampleData(
text="ROMEO. But soft! What light...",
extractions=[{"entity": "Romeo", "type": "character", "emotion": "hopeful"}]
)]
# 执行双重验证提取
result = lx.extract(text, prompt=prompt, examples=examples, model="gemini-2.5-pro", num_passes=2)

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish