Update README_ZH.md
Browse files- README_ZH.md +17 -300
README_ZH.md
CHANGED
|
@@ -9,35 +9,24 @@
|
|
| 9 |
|
| 10 |
[**数据集**](https://huggingface.co/datasets/zjunlp/iepie) |
|
| 11 |
[**论文**](https://huggingface.co/papers/2402.14710) |
|
| 12 |
-
[**使用方法**](
|
| 13 |
-
[**局限性**](./README_CN.md#
|
| 14 |
-
[**声明和许可**](./README_CN.md#
|
| 15 |
-
[**引用**](./README_CN.md#)
|
| 16 |
|
| 17 |
> 请注意,我们的IEPile可能会进行**更新**(一旦发布更新,我们将通知您)。建议使用最新版本。
|
| 18 |
|
| 19 |
|
| 20 |
- [IEPile:大规模信息提取语料库](#iepile大规模信息提取语料库)
|
| 21 |
-
- [
|
| 22 |
-
- [
|
| 23 |
- [2.1IEPile的构造](#21iepile的构造)
|
| 24 |
- [2.2IEPile的数据格式](#22iepile的数据格式)
|
| 25 |
-
- [
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
- [
|
| 30 |
-
- [4.1训练数据转换](#41训练数据转换)
|
| 31 |
-
- [4.2继续训练](#42继续训练)
|
| 32 |
-
- [👓5.预测](#5预测)
|
| 33 |
-
- [5.1测试数据转换](#51测试数据转换)
|
| 34 |
-
- [5.2基础模型+Lora预测](#52基础模型lora预测)
|
| 35 |
-
- [5.3IE专用模型预测](#53ie专用模型预测)
|
| 36 |
-
- [6.评估](#6评估)
|
| 37 |
-
- [7.声明和许可](#7声明和许可)
|
| 38 |
-
- [8.局限](#8局限)
|
| 39 |
-
- [9.引用](#9引用)
|
| 40 |
-
- [10. 致谢](#10-致谢)
|
| 41 |
|
| 42 |
|
| 43 |
## 🎯1.介绍
|
|
@@ -171,285 +160,13 @@
|
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
-
##
|
| 175 |
|
| 176 |
-
### 3.1环境
|
| 177 |
-
|
| 178 |
-
在开始之前,请确保按照下面的指导创建适当的**虚拟环境**:
|
| 179 |
-
|
| 180 |
-
```bash
|
| 181 |
-
conda create -n IEPile python=3.9 # 创建虚拟环境
|
| 182 |
-
conda activate IEPile # 激活环境
|
| 183 |
-
pip install -r requirements.txt # 安装依赖
|
| 184 |
-
```
|
| 185 |
-
|
| 186 |
-
### 3.2下载数据和模型
|
| 187 |
-
|
| 188 |
-
**`IEPile`** 数据集下载链接:[Google Drive](https://drive.google.com/file/d/1jPdvXOTTxlAmHkn5XkeaaCFXQkYJk5Ng/view?usp=sharing) | [Hugging Face](https://huggingface.co/datasets/zjunlp/IEPile)
|
| 189 |
-
|
| 190 |
-
```python
|
| 191 |
-
IEPile
|
| 192 |
-
├── train.json # 训练集
|
| 193 |
-
└── dev.json # 验证集
|
| 194 |
-
```
|
| 195 |
-
|
| 196 |
-
以下是本仓库代码支持的一些基础模型:[[llama](https://huggingface.co/meta-llama), [alpaca](https://github.com/tloen/alpaca-lora), [vicuna](https://huggingface.co/lmsys), [zhixi](https://github.com/zjunlp/KnowLM), [falcon](https://huggingface.co/tiiuae), [baichuan](https://huggingface.co/baichuan-inc), [chatglm](https://huggingface.co/THUDM), [qwen](https://huggingface.co/Qwen), [moss](https://huggingface.co/fnlp), [openba](https://huggingface.co/OpenBA)]
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
**`LLaMA2-IEPile`** | **`Baichuan2-IEPile`** | **`KnowLM-IE-v2`** 模型下载链接:[zjunlp/llama2-13b-IEPile-lora](https://huggingface.co/zjunlp/llama2-13b-IEPile-lora/tree/main) | [zjunlp/baichuan2-13b-IEPile-lora](https://huggingface.co/zjunlp/baichuan2-13b-IEPile-lora) | [zjunlp/KnowLM-IE-v2]()
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
**`LLaMA2-IEPile`**, **`Baichuan2-IEPile`** 是IEPILE论文中涉及的在 `LLaMA2-13B-Chat`, `Baichuan2-13B-Chat` 上Lora微调得到的两个模型。
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
```bash
|
| 207 |
-
mkdir data # 数据放这
|
| 208 |
-
mkdir mdoels # 基础模型放这
|
| 209 |
-
mkdir results # 预测结果放这
|
| 210 |
-
mkdir lora # lora微调结果放这
|
| 211 |
-
```
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
### 3.3LoRA微调
|
| 215 |
-
|
| 216 |
-
> 重要提示:以下的所有命令均应在`IEPile`目录下执行。例如,如果您想运行微调脚本,您应该使用如下命令:bash ft_scripts/fine_llama.bash。请确保您的当前工作目录正确。
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
```bash
|
| 220 |
-
output_dir='lora/llama2-13b-chat-v1'
|
| 221 |
-
mkdir -p ${output_dir}
|
| 222 |
-
CUDA_VISIBLE_DEVICES="0,1,2,3,4,5,6,7" torchrun --nproc_per_node=8 --master_port=1287 src/test_finetune.py \
|
| 223 |
-
--do_train --do_eval \
|
| 224 |
-
--overwrite_output_dir \
|
| 225 |
-
--model_name_or_path 'models/llama2-13b-chat' \
|
| 226 |
-
--stage 'sft' \
|
| 227 |
-
--model_name 'llama' \
|
| 228 |
-
--template 'llama2' \
|
| 229 |
-
--train_file 'data/train.json' \
|
| 230 |
-
--valid_file 'data/dev.json' \
|
| 231 |
-
--output_dir=${output_dir} \
|
| 232 |
-
--per_device_train_batch_size 24 \
|
| 233 |
-
--per_device_eval_batch_size 24 \
|
| 234 |
-
--gradient_accumulation_steps 4 \
|
| 235 |
-
--preprocessing_num_workers 16 \
|
| 236 |
-
--num_train_epochs 10 \
|
| 237 |
-
--learning_rate 5e-5 \
|
| 238 |
-
--max_grad_norm 0.5 \
|
| 239 |
-
--optim "adamw_torch" \
|
| 240 |
-
--max_source_length 400 \
|
| 241 |
-
--cutoff_len 700 \
|
| 242 |
-
--max_target_length 300 \
|
| 243 |
-
--report_to tensorboard \
|
| 244 |
-
--evaluation_strategy "epoch" \
|
| 245 |
-
--save_strategy "epoch" \
|
| 246 |
-
--save_total_limit 10 \
|
| 247 |
-
--lora_r 16 \
|
| 248 |
-
--lora_alpha 32 \
|
| 249 |
-
--lora_dropout 0.05 \
|
| 250 |
-
--bf16 \
|
| 251 |
-
--deepspeed configs/ds_config_bf16.json
|
| 252 |
-
```
|
| 253 |
-
|
| 254 |
-
* `model_name`: 指定所��的**模型架构名称**(7B、13B、Base、Chat属于同一模型架构)。当前支持的模型包括:["`llama`", "`alpaca`", "`vicuna`", "`zhixi`", "`falcon`", "`baichuan`", "`chatglm`", "`qwen`", "`moss`", "`openba`"]。**请注意**,此参数应与 `--model_name_or_path` 区分。
|
| 255 |
-
* `model_name_or_path`: 模型路径, 请到 [HuggingFace](https://huggingface.co/models) 下载相应模型。
|
| 256 |
-
* `template`: 使用的**模板名称**,包括:`alpaca`, `baichuan`, `baichuan2`, `chatglm3`等, 请参考 [src/datamodule/template.py](./src/datamodule/template.py) 查看所有支持的模版名称, 默认使用的是`alpaca`模板, **`Chat`版本的模型建议使用配套的模版, Base版本模型可默认使用`alpaca`**。
|
| 257 |
-
* `train_file`, `valid_file(可选)`: 训练集和验证集的**文件路径**。注意:目前仅支持json格式的文件。
|
| 258 |
-
* `output_dir`: LoRA微调后的**权重参数保存路径**。
|
| 259 |
-
* `val_set_size`: **验证集的样本数量**, 默认为1000。
|
| 260 |
-
* `per_device_train_batch_size`, `per_device_eval_batch_size`: 每台GPU设备上的`batch_size`, 根据显存大小调整。
|
| 261 |
-
* `max_source_length`, `max_target_length`, `cutoff_len`: 最大输入、输出长度、截断长度, 截断长度可以简单地视作最大输入长度 + 最大输出长度, 需根据具体需求和显存大小设置合适值。
|
| 262 |
-
* `deepspeed`: 设备资源不够可去掉。
|
| 263 |
-
|
| 264 |
-
> 可通过设置 `bits` = 8 或 4 进行量化。
|
| 265 |
-
|
| 266 |
-
* 要了解更多关于**参数配置**的信息,请参考 [src/utils/args](./src/args) 目录。
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
微调`LLaMA2-13B-Chat`模型的具体脚本可以在 [ft_scripts/fine_llama.bash](./ft_scripts/fine_llama.bash) 中找到。
|
| 270 |
-
|
| 271 |
-
微调`Baichuan2-13B-Chat`模型的具体脚本可以在 [ft_scripts/fine_baichuan.bash](./ft_scripts/fine_baichuan.bash) 中找到。
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
## 🔁4.领域内数据继续训练
|
| 276 |
-
|
| 277 |
-
尽管 `Baichuan2-IEPile` 和 `LLaMA2-IEPile` 模型已在多个通用数据集上接受了广泛的指令微调,并因此获得了一定的**通用信息抽取能力**,但它们在**特定领域**(如`法律`、`教育`、`科学`、`电信`)的数据处理上可能仍显示出一定的局限性。针对这一挑战,建议对这些模型在特定领域的数据集上进行**二次训练**。这将有助于模型更好地适应特定领域的语义和结构特征,从而显著增强其在**该领域内的信息抽取能力**。
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
#### 4.1训练数据转换
|
| 281 |
-
|
| 282 |
-
首先, 需要将**数据格式化**以包含`instruction`、`output`字段。为此,我们提供了一个脚本 [convert_func.py](./ie2instruction/convert_func.py),它可以将数据批量转换成模型可以直接使用的格式。
|
| 283 |
-
|
| 284 |
-
> 在使用 [convert_func.py](./ie2instruction/convert_func.py) 脚本之前,请确保参考了 [data](./data) 目录。该目录详细说明了每种任务所需的数据格式要求。 `sample.json` 描述了转换前数据的格式,`schema.json` 展示了 schema 的组织结构, `train.json` 描述了转换后的数据格式。
|
| 285 |
-
|
| 286 |
-
> 此外,可直接使用包含12个主题(如人物、交通工具、艺术作品、自然科学、人造物品、天文对象等)的中英双语信息抽取数据集 [zjunlp/InstructIE](https://huggingface.co/datasets/zjunlp/InstructIE)。
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
```bash
|
| 290 |
-
python ie2instruction/convert_func.py \
|
| 291 |
-
--src_path data/NER/sample.json \
|
| 292 |
-
--tgt_path data/NER/train.json \
|
| 293 |
-
--schema_path data/NER/schema.json \
|
| 294 |
-
--language zh \
|
| 295 |
-
--task NER \
|
| 296 |
-
--split_num 6 \
|
| 297 |
-
--random_sort \
|
| 298 |
-
--split train
|
| 299 |
-
```
|
| 300 |
-
|
| 301 |
-
* `language`: 支持`zh`, `en`两种语言, 不同语言使用的指令模版不同。
|
| 302 |
-
* `task`: 目前支持['`RE`', '`NER`', '`EE`', '`EET`', '`EEA`']五类任务。
|
| 303 |
-
* `split_num`: 定义单个指令中可包含的最大schema数目。默认值为4,设置为-1则不进行切分。推荐的任务切分数量依任务而异:**NER建议为6,RE、EE、EET、EEA均推荐为4**。
|
| 304 |
-
* `random_sort`: 是否对指令中的schema随机排序, 默认为False, 即按字母顺序排序。
|
| 305 |
-
* `split`: 指定数据集类型,可选`train`或`test`。
|
| 306 |
-
|
| 307 |
-
转换后的训练数据将包含 `task`, `source`, `instruction`, `output` 四个字段。
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
#### 4.2继续训练
|
| 312 |
-
|
| 313 |
-
```bash
|
| 314 |
-
output_dir='lora/llama2-13b-chat-v1-continue'
|
| 315 |
-
mkdir -p ${output_dir}
|
| 316 |
-
CUDA_VISIBLE_DEVICES="0,1,2,3,4,5,6,7" torchrun --nproc_per_node=8 --master_port=1287 src/test_finetune.py \
|
| 317 |
-
--do_train --do_eval \
|
| 318 |
-
--overwrite_output_dir \
|
| 319 |
-
--model_name_or_path 'models/llama2-13B-Chat' \
|
| 320 |
-
--checkpoint_dir 'zjunlp/llama2-13b-iepile-lora' \
|
| 321 |
-
--stage 'sft' \
|
| 322 |
-
--model_name 'llama' \
|
| 323 |
-
--template 'llama2' \
|
| 324 |
-
--train_file 'data/train.json' \
|
| 325 |
-
--valid_file 'data/dev.json' \
|
| 326 |
-
--output_dir=${output_dir} \
|
| 327 |
-
--per_device_train_batch_size 24 \
|
| 328 |
-
--per_device_eval_batch_size 24 \
|
| 329 |
-
--gradient_accumulation_steps 4 \
|
| 330 |
-
--preprocessing_num_workers 16 \
|
| 331 |
-
--num_train_epochs 10 \
|
| 332 |
-
--learning_rate 5e-5 \
|
| 333 |
-
--max_grad_norm 0.5 \
|
| 334 |
-
--optim "adamw_torch" \
|
| 335 |
-
--max_source_length 400 \
|
| 336 |
-
--cutoff_len 700 \
|
| 337 |
-
--max_target_length 300 \
|
| 338 |
-
--report_to tensorboard \
|
| 339 |
-
--evaluation_strategy "epoch" \
|
| 340 |
-
--save_strategy "epoch" \
|
| 341 |
-
--save_total_limit 10 \
|
| 342 |
-
--lora_r 64 \
|
| 343 |
-
--lora_alpha 64 \
|
| 344 |
-
--lora_dropout 0.05 \
|
| 345 |
-
--bf16
|
| 346 |
-
```
|
| 347 |
-
|
| 348 |
-
* 若要基于微调后的LoRA权重继续训练,仅需将 `checkpoint_dir` 参数指向LoRA权重路径,例如设置为`'zjunlp/llama2-13b-iepile-lora'`。
|
| 349 |
-
|
| 350 |
-
> 可通过设置 `bits` = 8 或 4 进行量化。
|
| 351 |
-
|
| 352 |
-
> 请注意,在使用 **`LLaMA2-IEPile`** 或 **`Baichuan2-IEPile`** 时,保持lora_r和lora_alpha均为64,对于这些参数,我们不提供推荐设置。
|
| 353 |
-
|
| 354 |
-
* 若要基于微调后的模型权重继续训练,只需设定 `model_name_or_path` 参数为权重路径,如`'zjunlp/KnowLM-IE-v2'`,无需设置`checkpoint_dir`。
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
脚本可以在 [ft_scripts/fine_continue.bash](./ft_scripts/fine_continue.bash) 中找到。
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
## 👓5.预测
|
| 362 |
-
|
| 363 |
-
### 5.1测试数据转换
|
| 364 |
-
|
| 365 |
-
在准备测试数据转换之前,请访问 [data](./data) 目录以了解各任务所需的数据结构:1)输入数据格式参见 `sample.json`;2)schema格式请查看 `schema.json`;3)转换后数据格式可参照 `train.json`。**与训练数据不同, 测试数据的输入无需包含标注字段(`entity`, `relation`, `event`)**。
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
```bash
|
| 369 |
-
python ie2instruction/convert_func.py \
|
| 370 |
-
--src_path data/NER/sample.json \
|
| 371 |
-
--tgt_path data/NER/test.json \
|
| 372 |
-
--schema_path data/NER/schema.json \
|
| 373 |
-
--language zh \
|
| 374 |
-
--task NER \
|
| 375 |
-
--split_num 6 \
|
| 376 |
-
--split test
|
| 377 |
-
```
|
| 378 |
-
|
| 379 |
-
设置 `split` 为 **test** 时,请根据任务类型选择适当的schema数量:**NER推荐为6,而RE、EE、EET、EEA推荐为4**。转换后的测试数据将含有`id`, `task`, `source`, `instruction`, `label`五个字段。
|
| 380 |
-
|
| 381 |
-
`label` 字段将用于后续评估。若输入数据中缺少标注字段(`entity`, `relation`, `event`),则转换后的测试数据将不包含`label`字段,适用于那些无原始标注数据的场景。
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
### 5.2基础模型+Lora预测
|
| 386 |
-
|
| 387 |
-
```bash
|
| 388 |
-
CUDA_VISIBLE_DEVICES=0 python src/inference.py \
|
| 389 |
-
--stage sft \
|
| 390 |
-
--model_name_or_path 'models/llama2-13B-Chat' \
|
| 391 |
-
--checkpoint_dir 'zjunlp/llama2-13b-IEPile-lora' \
|
| 392 |
-
--model_name 'llama' \
|
| 393 |
-
--template 'llama2' \
|
| 394 |
-
--do_predict \
|
| 395 |
-
--input_file 'data/input.json' \
|
| 396 |
-
--output_file 'results/llama2-13b-IEPile-lora_output.json' \
|
| 397 |
-
--finetuning_type lora \
|
| 398 |
-
--output_dir 'lora/test' \
|
| 399 |
-
--predict_with_generate \
|
| 400 |
-
--max_source_length 512 \
|
| 401 |
-
--bf16 \
|
| 402 |
-
--max_new_tokens 300
|
| 403 |
-
```
|
| 404 |
-
|
| 405 |
-
* 在进行推理时,`model_name`, `template`, 和 `bf16` 必须与训练时的设置相同。
|
| 406 |
-
* `model_name_or_path`: 指定所使用的基础模型路径,必须与相应的LoRA模型匹配。
|
| 407 |
-
* `checkpoint_dir`: LoRA的权重文件路径。
|
| 408 |
-
* `output_dir`: 此参数在推理时不起作用,可以随意指定一个路径。
|
| 409 |
-
* `input_file`, `output_file`: 分别指定输入的测试文件路径和预测结果的输出文件路径。
|
| 410 |
-
* `max_source_length`, `max_new_tokens`: 设置最大的输入长度和生成的新token数量,根据显存大小进行调整。
|
| 411 |
-
|
| 412 |
-
> 可通过设置 `bits` = 8 或 4 进行量化。
|
| 413 |
-
|
| 414 |
-
### 5.3IE专用模型预测
|
| 415 |
-
|
| 416 |
-
```bash
|
| 417 |
-
CUDA_VISIBLE_DEVICES=0 python src/inference.py \
|
| 418 |
-
--stage sft \
|
| 419 |
-
--model_name_or_path 'zjunlp/KnowLM-IE-v2' \
|
| 420 |
-
--model_name 'baichuan' \
|
| 421 |
-
--template 'baichuan2' \
|
| 422 |
-
--do_predict \
|
| 423 |
-
--input_file 'data/input.json' \
|
| 424 |
-
--output_file 'results/KnowLM-IE-v2_output.json' \
|
| 425 |
-
--output_dir 'lora/test' \
|
| 426 |
-
--predict_with_generate \
|
| 427 |
-
--max_source_length 512 \
|
| 428 |
-
--bf16 \
|
| 429 |
-
--max_new_tokens 300
|
| 430 |
-
```
|
| 431 |
-
|
| 432 |
-
`model_name_or_path`: IE专用模型权重路径
|
| 433 |
-
|
| 434 |
-
> 可通过设置 `bits` = 8 或 4 进行量化。
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
## 6.评估
|
| 438 |
-
|
| 439 |
-
我们提供了评估各个任务F1分数的脚本。
|
| 440 |
-
|
| 441 |
-
```bash
|
| 442 |
-
python ie2instruction/eval_func.py \
|
| 443 |
-
--path1 data/NER/processed.json \
|
| 444 |
-
--task NER
|
| 445 |
-
```
|
| 446 |
-
|
| 447 |
-
* `task`: 目前支持['RE', 'NER', 'EE', 'EET', 'EEA']五类任务。
|
| 448 |
-
* 可以设置 `sort_by` 为 `source`, 分别计算每个数据集上的F1分数。
|
| 449 |
|
|
|
|
| 450 |
|
| 451 |
|
| 452 |
-
##
|
| 453 |
|
| 454 |
我们认为标注数据蕴含着人类的智慧宝库,它的存在是为了促进全人类的利益,并有助于提升我们的生活质量。我们强烈敦促所有的用户不要将我们的语料库用于任何可能对国家或公共安全造成伤害、违反法律法规的行为。
|
| 455 |
我们竭尽所能地保证所提供数据的质量与其合法性。但我们也意识到,尽管如此,可能还是存在一些不可预见的问题,诸如数据保护的担忧以及数据被滥用可能引起的风险和问题。对于这些潜在的问题,我们将不承担责任。
|
|
@@ -457,16 +174,16 @@ python ie2instruction/eval_func.py \
|
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
-
##
|
| 461 |
|
| 462 |
从数据角度来看,我们的研究主要集��在基于schema的信息提取(IE)上,这限制了我们将研究成果推广至不遵循我们特定格式要求的人类指令的能力。此外,我们没有探索开放信息提取(Open IE)领域;然而,如果我们去除schema约束,我们的数据集将适用于开放信息提取场景。此外,我们的数据集目前仅包含英语和中文数据,在未来,我们希望能够包含更多语言的数据。
|
| 463 |
从模型的角度来看,由于计算资源的限制,我们的研究仅评估了两个模型:Baichuan和LLaMA,以及一些基线模型。我们的数据集可以应用于任何其他的大型语言模型(LLMs),如Qwen、ChatGLM。
|
| 464 |
|
| 465 |
|
| 466 |
-
##
|
| 467 |
如果您使用IEPile或代码,请引用以下论文:
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
-
##
|
| 472 |
我们非常感谢[MathPile](mathpile)和[KnowledgePile](https://huggingface.co/datasets/Query-of-CC/Knowledge_Pile)项目提供的宝贵灵感。我们对以下数据集构建者和维护者表示特别的谢意:[AnatEM](https://doi.org/10.1093/BIOINFORMATICS/BTT580)、[BC2GM](https://link.springer.com/chapter/10.1007/978-3-030-68763-2_48)、[BC4CHEMD](https://link.springer.com/chapter/10.1007/978-3-030-68763-2_48)、[NCBI-Disease](https://linkinghub.elsevier.com/retrieve/pii/S1532046413001974)、[BC5CDR](https://openreview.net/pdf?id=9EAQVEINuum)、[HarveyNER](https://aclanthology.org/2022.naacl-main.243/)、[CoNLL2003](https://aclanthology.org/W03-0419/)、[GENIA](https://pubmed.ncbi.nlm.nih.gov/12855455/)、[ACE2005](https://catalog.ldc.upenn.edu/LDC2006T06)、[MIT Restaurant](https://ieeexplore.ieee.org/document/6639301)、[MIT Movie](https://ieeexplore.ieee.org/document/6639301)、[FabNER](https://link.springer.com/article/10.1007/s10845-021-01807-x)、[MultiNERD](https://aclanthology.org/2022.findings-naacl.60/)、[Ontonotes](https://aclanthology.org/N09-4006/)、[FindVehicle](https://arxiv.org/abs/2304.10893)、[CrossNER](https://ojs.aaai.org/index.php/AAAI/article/view/17587)、[MSRA NER](https://aclanthology.org/W06-0115/)、[Resume NER](https://aclanthology.org/P18-1144/)、[CLUE NER](https://arxiv.org/abs/2001.04351)、[Weibo NER](https://aclanthology.org/D15-1064/)、[Boson](https://github.com/InsaneLife/ChineseNLPCorpus/tree/master/NER/boson)、[ADE Corpus](https://jbiomedsem.biomedcentral.com/articles/10.1186/2041-1480-3-15)、[GIDS](https://arxiv.org/abs/1804.06987)、[CoNLL2004](https://aclanthology.org/W04-2412/)、[SciERC](https://aclanthology.org/D18-1360/)、[Semeval-RE](https://aclanthology.org/S10-1006/)、[NYT11-HRL](https://ojs.aaai.org/index.php/AAAI/article/view/4688)、[KBP37](https://arxiv.org/abs/1508.01006)、[NYT](https://link.springer.com/chapter/10.1007/978-3-642-15939-8_10)、[Wiki-ZSL](https://aclanthology.org/2021.naacl-main.272/)、[FewRel](https://aclanthology.org/D18-1514/)、[CMeIE](https://link.springer.com/chapter/10.1007/978-3-030-60450-9_22)、[DuIE](https://link.springer.com/chapter/10.1007/978-3-030-32236-6_72)、[COAE2016](https://github.com/Sewens/COAE2016)、[IPRE](https://arxiv.org/abs/1907.12801)、[SKE2020](https://aistudio.baidu.com/datasetdetail/177191)、[CASIE](https://ojs.aaai.org/index.php/AAAI/article/view/6401)、[PHEE](https://aclanthology.org/2022.emnlp-main.376/)、[CrudeOilNews](https://aclanthology.org/2022.lrec-1.49/)、[RAMS](https://aclanthology.org/2020.acl-main.718/)、[WikiEvents](https://aclanthology.org/2021.naacl-main.69/)、[DuEE](https://link.springer.com/chapter/10.1007/978-3-030-60457-8_44)、[DuEE-Fin](https://link.springer.com/chapter/10.1007/978-3-031-17120-8_14)、[FewFC](https://ojs.aaai.org/index.php/AAAI/article/view/17720)、[CCF law](https://aistudio.baidu.com/projectdetail/4201483)等,这些数据集极大地促进了本研究的进展。我们也要对[InstructUIE](http://arxiv.org/abs/2304.08085)与[YAYI-UIE](http://arxiv.org/abs/2312.15548)为数据和模型在信息抽取领域做出的宝贵贡献表示感激。我们的研究成果同样得益于他们的创新和努力。此外,我们要对[hiyouga/LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory)表示衷心的感谢,我们的微调代码实现在很大程度上参考了他们的工作。通过这些学术资源的辅助,我们得以完成本项研究,对此我们深表感激。
|
|
|
|
| 9 |
|
| 10 |
[**数据集**](https://huggingface.co/datasets/zjunlp/iepie) |
|
| 11 |
[**论文**](https://huggingface.co/papers/2402.14710) |
|
| 12 |
+
[**使用方法**](https://github.com/zjunlp/IEPile) |
|
| 13 |
+
[**局限性**](./README_CN.md#5局限) |
|
| 14 |
+
[**声明和许可**](./README_CN.md#4声明和许可) |
|
| 15 |
+
[**引用**](./README_CN.md#6引用)
|
| 16 |
|
| 17 |
> 请注意,我们的IEPile可能会进行**更新**(一旦发布更新,我们将通知您)。建议使用最新版本。
|
| 18 |
|
| 19 |
|
| 20 |
- [IEPile:大规模信息提取语料库](#iepile大规模信息提取语料库)
|
| 21 |
+
- [1.介绍](#1介绍)
|
| 22 |
+
- [2.数据](#2数据)
|
| 23 |
- [2.1IEPile的构造](#21iepile的构造)
|
| 24 |
- [2.2IEPile的数据格式](#22iepile的数据格式)
|
| 25 |
+
- [3.使用IEPile训练模型](#3使用iepile训练模型)
|
| 26 |
+
- [4.声明和许可](#4声明和许可)
|
| 27 |
+
- [5.局限](#5局限)
|
| 28 |
+
- [6.引用](#6引用)
|
| 29 |
+
- [7.致谢](#7致谢)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
## 🎯1.介绍
|
|
|
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
+
## 3.使用IEPile训练模型
|
| 164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
+
欲了解如何使用IEPile进行模型的训练与推理,请访问我们的官方GitHub仓库以获取详细教程:[IEPile](https://github.com/zjunlp/IEPile)。
|
| 167 |
|
| 168 |
|
| 169 |
+
## 4.声明和许可
|
| 170 |
|
| 171 |
我们认为标注数据蕴含着人类的智慧宝库,它的存在是为了促进全人类的利益,并有助于提升我们的生活质量。我们强烈敦促所有的用户不要将我们的语料库用于任何可能对国家或公共安全造成伤害、违反法律法规的行为。
|
| 172 |
我们竭尽所能地保证所提供数据的质量与其合法性。但我们也意识到,尽管如此,可能还是存在一些不可预见的问题,诸如数据保护的担忧以及数据被滥用可能引起的风险和问题。对于这些潜在的问题,我们将不承担责任。
|
|
|
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
+
## 5.局限
|
| 178 |
|
| 179 |
从数据角度来看,我们的研究主要集��在基于schema的信息提取(IE)上,这限制了我们将研究成果推广至不遵循我们特定格式要求的人类指令的能力。此外,我们没有探索开放信息提取(Open IE)领域;然而,如果我们去除schema约束,我们的数据集将适用于开放信息提取场景。此外,我们的数据集目前仅包含英语和中文数据,在未来,我们希望能够包含更多语言的数据。
|
| 180 |
从模型的角度来看,由于计算资源的限制,我们的研究仅评估了两个模型:Baichuan和LLaMA,以及一些基线模型。我们的数据集可以应用于任何其他的大型语言模型(LLMs),如Qwen、ChatGLM。
|
| 181 |
|
| 182 |
|
| 183 |
+
## 6.引用
|
| 184 |
如果您使用IEPile或代码,请引用以下论文:
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
+
## 7.致谢
|
| 189 |
我们非常感谢[MathPile](mathpile)和[KnowledgePile](https://huggingface.co/datasets/Query-of-CC/Knowledge_Pile)项目提供的宝贵灵感。我们对以下数据集构建者和维护者表示特别的谢意:[AnatEM](https://doi.org/10.1093/BIOINFORMATICS/BTT580)、[BC2GM](https://link.springer.com/chapter/10.1007/978-3-030-68763-2_48)、[BC4CHEMD](https://link.springer.com/chapter/10.1007/978-3-030-68763-2_48)、[NCBI-Disease](https://linkinghub.elsevier.com/retrieve/pii/S1532046413001974)、[BC5CDR](https://openreview.net/pdf?id=9EAQVEINuum)、[HarveyNER](https://aclanthology.org/2022.naacl-main.243/)、[CoNLL2003](https://aclanthology.org/W03-0419/)、[GENIA](https://pubmed.ncbi.nlm.nih.gov/12855455/)、[ACE2005](https://catalog.ldc.upenn.edu/LDC2006T06)、[MIT Restaurant](https://ieeexplore.ieee.org/document/6639301)、[MIT Movie](https://ieeexplore.ieee.org/document/6639301)、[FabNER](https://link.springer.com/article/10.1007/s10845-021-01807-x)、[MultiNERD](https://aclanthology.org/2022.findings-naacl.60/)、[Ontonotes](https://aclanthology.org/N09-4006/)、[FindVehicle](https://arxiv.org/abs/2304.10893)、[CrossNER](https://ojs.aaai.org/index.php/AAAI/article/view/17587)、[MSRA NER](https://aclanthology.org/W06-0115/)、[Resume NER](https://aclanthology.org/P18-1144/)、[CLUE NER](https://arxiv.org/abs/2001.04351)、[Weibo NER](https://aclanthology.org/D15-1064/)、[Boson](https://github.com/InsaneLife/ChineseNLPCorpus/tree/master/NER/boson)、[ADE Corpus](https://jbiomedsem.biomedcentral.com/articles/10.1186/2041-1480-3-15)、[GIDS](https://arxiv.org/abs/1804.06987)、[CoNLL2004](https://aclanthology.org/W04-2412/)、[SciERC](https://aclanthology.org/D18-1360/)、[Semeval-RE](https://aclanthology.org/S10-1006/)、[NYT11-HRL](https://ojs.aaai.org/index.php/AAAI/article/view/4688)、[KBP37](https://arxiv.org/abs/1508.01006)、[NYT](https://link.springer.com/chapter/10.1007/978-3-642-15939-8_10)、[Wiki-ZSL](https://aclanthology.org/2021.naacl-main.272/)、[FewRel](https://aclanthology.org/D18-1514/)、[CMeIE](https://link.springer.com/chapter/10.1007/978-3-030-60450-9_22)、[DuIE](https://link.springer.com/chapter/10.1007/978-3-030-32236-6_72)、[COAE2016](https://github.com/Sewens/COAE2016)、[IPRE](https://arxiv.org/abs/1907.12801)、[SKE2020](https://aistudio.baidu.com/datasetdetail/177191)、[CASIE](https://ojs.aaai.org/index.php/AAAI/article/view/6401)、[PHEE](https://aclanthology.org/2022.emnlp-main.376/)、[CrudeOilNews](https://aclanthology.org/2022.lrec-1.49/)、[RAMS](https://aclanthology.org/2020.acl-main.718/)、[WikiEvents](https://aclanthology.org/2021.naacl-main.69/)、[DuEE](https://link.springer.com/chapter/10.1007/978-3-030-60457-8_44)、[DuEE-Fin](https://link.springer.com/chapter/10.1007/978-3-031-17120-8_14)、[FewFC](https://ojs.aaai.org/index.php/AAAI/article/view/17720)、[CCF law](https://aistudio.baidu.com/projectdetail/4201483)等,这些数据集极大地促进了本研究的进展。我们也要对[InstructUIE](http://arxiv.org/abs/2304.08085)与[YAYI-UIE](http://arxiv.org/abs/2312.15548)为数据和模型在信息抽取领域做出的宝贵贡献表示感激。我们的研究成果同样得益于他们的创新和努力。此外,我们要对[hiyouga/LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory)表示衷心的感谢,我们的微调代码实现在很大程度上参考了他们的工作。通过这些学术资源的辅助,我们得以完成本项研究,对此我们深表感激。
|