GithubHelp home page GithubHelp logo

jqk6 / guwenee Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lyn4ever29/guwenee

0.0 1.0 0.0 40.09 MB

a Corpus for Classical Chinese Language Event Extraction

License: Creative Commons Attribution 4.0 International

Shell 0.32% Python 99.68%

guwenee's Introduction

GuwenEE

古汉语事件抽取语料库


Download License

If you want to read this instruction in English, please click here.

本仓库是古汉语事件抽取的语料库GuwenEE及其基准测评代码库。

目录

语料库介绍

本语料库是一个古汉语领域事件抽取语料库,原始数据来自《二十四史》,从中随机抽取部分句子作为标注语料,通过大规模语言模型与人工相结合的方式构建。 包含古汉语句子1000条,7个事件类别(一个分类),72个事件类型(二级分类),1928 个事件。 本语料库构建的事件类型如下:

事件类别 事件类型
人生 出生,婚嫁,死亡,继承,高中,......
战争 起兵事件,进攻事件,出征事件,围攻事件,......
政治 推举事件,诬陷事件,叛变事件,诏谕事件,......
民事 迁徙事件,宗教事件,射箭事件,其他事件,......
日常 会见事件,交谈事件,出行事件,谴责事件,......
文化 历史记载,撰写事件,......
地理 地震,海汛,流星雨,......

以下是本语料库示例:

{
    "text": "十二月己未,突厥复攻茹茹,茹茹举国南奔。",
    "id": "c255a834c06e459d8be4b88d01c347aa",
    "event_list": [
        {
            "event_type": "战争/进攻事件",
            "trigger": "",
            "trigger_start_index": 9,
            "arguments": [
                {
                    "argument_start_index": 0,
                    "role": "时间",
                    "argument": "十二月己未",
                    "alias": []
                },
                {
                    "argument_start_index": 10,
                    "role": "被攻击者",
                    "argument": "茹茹",
                    "alias": []
                },
                {
                    "argument_start_index": 6,
                    "role": "进攻者",
                    "argument": "突厥",
                    "alias": []
                }
            ],
            "class": "战争"
        },
        {
            "event_type": "战争/逃逸事件",
            "trigger": "",
            "trigger_start_index": 18,
            "arguments": [
                {
                    "argument_start_index": 0,
                    "role": "时间",
                    "argument": "十二月己未",
                    "alias": []
                },
                {
                    "argument_start_index": 17,
                    "role": "地点",
                    "argument": "",
                    "alias": []
                },
                {
                    "argument_start_index": 13,
                    "role": "逃逸者",
                    "argument": "茹茹举国",
                    "alias": []
                }
            ],
            "class": "战争"
        }
    ]
}

语料库下载

本语料库提供标注结果和事件Schema,您可以在本仓库中Releases中下载 或者从OPENKG.CN下载GuwenEE:细粒度古汉语事件抽取数据集

测评实验运行

实验设计

使用4个在古汉语领域的预训练模型在事件抽取的子任务上进行实验。

安装环境

运行本仓库代码,需要Python 3.9+,Pytorch 1.12.1+,transform 4.21.0+

pip install -r requirements.txt 

模型下载

jiayan分词器模型

由于项目使用的jiayan分词器需要使用jiayan.klm,请点击下载jiayan.klm保存至tools目录下

以上链接来自官方,如无法访问,请提issue给我

古文预训练模型

本文所用预训练模型来自于huggingface,请将模型下载到本地加载使用,下载到本地model目录下

数据处理

cd data
python data_processed.py --data_dir ./original  --save_dir ./processed

修改配置文件

项目配置文件在config目录下,其中包含各个模型的相关配置,您可以根据自己的需要修改。更多内容,请参考OmniEvent

运行ED序列标注任务

python ./scripts/ED/sequence_labeling.py ../../config/ED/sikubert/guwenee.yaml

运行EAE序列标注任务

python ./scripts/ED/sequence_labeling.py ../../config/ED/sikubert/guwenee.yaml

实验测评结果

Guwen-BERT roberta-clas-sical-chinese-base Siku-BERT Siku-RoBERTaED
ED Precision 27.10 58.72 63.09 59.30
Recall 27.10 28.34 48.30 45.17
F1 38.77 38.23 54.71 51.28
EAE Precision 21.42 20.05 45.56 40.40
Recall 11.96 8.15 43.26 39.61
F1 14.50 11.57 44.38 40.00

附录

本仓库代码使用的开源框架如下,在此感谢他们在相关开源工作中的贡献。

guwenee's People

Contributors

lyn4ever29 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.