Skip to content

Conversation

@e06084
Copy link
Collaborator

@e06084 e06084 commented Oct 15, 2025

概述

LLMHtmlExtractCompareV2 是用于对比评估两种 HTML 内容提取工具效果的增强版本。相比 V1 版本,V2 版本采用了更高效的评估策略,大幅减少了 token 消耗。

基础用法

import os
from dingo.io import Data
from dingo.model.llm.llm_html_extract_compare_v2 import LLMHtmlExtractCompareV2

# 初始化评估器
evaluator = LLMHtmlExtractCompareV2()
evaluator.dynamic_config.model = 'gpt-4'
evaluator.dynamic_config.key = os.getenv("OPENAI_KEY")
evaluator.dynamic_config.api_url = 'https://api.openai.com/v1'

# 准备数据
data = Data(
    data_id="test_001",
    prompt="工具A提取的内容...",
    content="工具B提取的文本内容",
    raw_data={
        "language": "zh"
    }
)

# 执行评估
result = evaluator.eval(data)

# 查看结果
print(f"判断: {result.type}")
print(f"推理: {result.reason[0]}")

@shijinpjlab shijinpjlab merged commit 30a8fc1 into MigoXLab:dev Oct 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants