Skip to content

Commit 35f2bba

Browse files
committed
x
1 parent 42b24e8 commit 35f2bba

File tree

2 files changed

+10
-70
lines changed

2 files changed

+10
-70
lines changed

README.md

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pip install dingo-python
5555

5656
## Example Use Cases
5757

58-
### 1. Evaluate Stream Data
58+
### 1. Evaluate LLM chat data
5959

6060
```python
6161
from dingo.config.config import DynamicLLMConfig
@@ -71,9 +71,9 @@ data = MetaData(
7171

7272
def llm():
7373
LLMTextQualityModelBase.dynamic_config = DynamicLLMConfig(
74-
key='',
75-
api_url='',
76-
# model='',
74+
key='YOUR_API_KEY',
75+
api_url='https://api.openai.com/v1/chat/completions',
76+
model='gpt-4o',
7777
)
7878
res = LLMTextQualityModelBase.eval(data)
7979
print(res)
@@ -84,7 +84,7 @@ def rule():
8484
print(res)
8585
```
8686

87-
### 2. Evaluate Hugging Face Dataset
87+
### 2. Evaluate Dataset
8888

8989
```python
9090
from dingo.io import InputArgs
@@ -104,36 +104,6 @@ result = executor.execute()
104104
print(result)
105105
```
106106

107-
### 3. Using LLM for Evaluation
108-
109-
```python
110-
from dingo.io import InputArgs
111-
from dingo.exec import Executor
112-
113-
# Evaluate using GPT model
114-
input_data = {
115-
"input_path": "data.jsonl", # Path to local JSONL file
116-
"dataset": "local",
117-
"data_format": "jsonl",
118-
"column_content": "content",
119-
"custom_config": {
120-
"prompt_list": ["PromptRepeat"], # Prompt to use
121-
"llm_config": {
122-
"detect_text_quality": {
123-
"model": "gpt-4o",
124-
"key": "YOUR_API_KEY",
125-
"api_url": "https://api.openai.com/v1/chat/completions"
126-
}
127-
}
128-
}
129-
}
130-
131-
input_args = InputArgs(**input_data)
132-
executor = Executor.exec_map["local"](input_args)
133-
result = executor.execute()
134-
print(result)
135-
```
136-
137107
## Command Line Interface
138108

139109
### Evaluate with Rule Sets

README_zh-CN.md

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pip install dingo-python
5353

5454
## 2. 使用示例
5555

56-
### 2.1 评估流式数据
56+
### 2.1 评估LLM对话数据
5757

5858
```python
5959
from dingo.config.config import DynamicLLMConfig
@@ -69,9 +69,9 @@ data = MetaData(
6969

7070
def llm():
7171
LLMTextQualityModelBase.dynamic_config = DynamicLLMConfig(
72-
key='',
73-
api_url='',
74-
# model='',
72+
key='YOUR_API_KEY',
73+
api_url='https://api.openai.com/v1/chat/completions',
74+
model='gpt-4o',
7575
)
7676
res = LLMTextQualityModelBase.eval(data)
7777
print(res)
@@ -82,7 +82,7 @@ def rule():
8282
print(res)
8383
```
8484

85-
### 2.2 评估Hugging Face数据集
85+
### 2.2 评估数据集
8686

8787
```python
8888
from dingo.io import InputArgs
@@ -102,36 +102,6 @@ result = executor.execute()
102102
print(result)
103103
```
104104

105-
### 2.3 使用LLM进行评估
106-
107-
```python
108-
from dingo.io import InputArgs
109-
from dingo.exec import Executor
110-
111-
# 使用GPT模型评估
112-
input_data = {
113-
"input_path": "data.jsonl", # 本地JSONL文件路径
114-
"dataset": "local",
115-
"data_format": "jsonl",
116-
"column_content": "content",
117-
"custom_config": {
118-
"prompt_list": ["PromptRepeat"], # 使用的prompt
119-
"llm_config": {
120-
"detect_text_quality": {
121-
"model": "gpt-4o",
122-
"key": "您的API密钥",
123-
"api_url": "https://api.openai.com/v1/chat/completions"
124-
}
125-
}
126-
}
127-
}
128-
129-
input_args = InputArgs(**input_data)
130-
executor = Executor.exec_map["local"](input_args)
131-
result = executor.execute()
132-
print(result)
133-
```
134-
135105
## 3. 命令行界面
136106

137107
### 3.1 使用规则集评估

0 commit comments

Comments
 (0)