# Multi-View-of-Expert-for-Chinese-Relation-Extraction **Repository Path**: tmg-nudt/multi-view-of-expert-for-chinese-relation-extraction ## Basic Information - **Project Name**: Multi-View-of-Expert-for-Chinese-Relation-Extraction - **Description**: PAKDD23: - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-03-07 - **Last Updated**: 2024-12-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Introduction code for < PAKDD2023 > < Dynamic Multi-View Fusion Mechanism For Chinese Relation Extraction> # Requirements General - Python (verified on 3.8) - CUDA (verified on 11.1/10.2) - torch (1.7.1) ``` pip install -r requirments.txt ``` # Quick Start ### dataset ``` /workspace/MoVE_V0/data (31.89MB) ├── SanWen (1.66MB) │ ├── train.txt (1.35MB) │ ├── rel2id.txt (103b) │ ├── test.txt (168.93KB) │ └── valid.txt (145.42KB) ├── Toy (11.96KB) │ ├── toy.txt (11.91KB) │ └── rel2id.txt (46b) ├── FinRE_withNA (3.32MB) │ ├── train.txt (2.39MB) │ ├── rel2id.txt (527b) │ ├── test.txt (682.01KB) │ └── valid.txt (272.12KB) ├── FinRE (2.41MB) │ ├── train.txt (1.73MB) │ ├── rel2id.txt (484b) │ ├── test.txt (494.76KB) │ └── valid.txt (201.78KB) ├── eda.py (1.12KB) ├── SciRE (6.15MB) │ ├── train.txt (4.3MB) │ ├── dev.txt (660.95KB) │ ├── rel2id.txt (46b) │ └── test.txt (1.2MB) ├── clearn.py (2.56KB) ├── SciRE_withNA (15.87MB) │ ├── train.txt (11.22MB) │ ├── dev.txt (1.57MB) │ ├── rel2id.txt (46b) │ └── test.txt (3.09MB) └── SanWen_withNA (2.47MB) ├── train.txt (1.99MB) ├── rel2id.txt (102b) ├── test.txt (265.03KB) └── valid.txt (221.64KB) ``` ### train ``` bash shells/run_finre.sh ``` ``` bash shells/run_sanwen.sh ``` ``` bash shells/run_scire.sh ``` ### hyper-param [model/config_layer.py] ``` # ====================== config_encoder = dict( use_radical=True, use_lexicon=True, use_synoym=False, multiview_feature_dim=100, hidden_dim=512, pooler_dim=100, ) ### TODO ## 这里的input_dim和hidden_dim 随着 特征的维度会变化 config_fuse = dict( input_dim=1368, # [300, 768, 868, 968] hidden_dim=1368, # [300, 768, 868, 968] num_layer=1, ) config_classifier = dict( input_dim=1368, # [300, 768, 868, 968] hidden_dim=512, pooling_type="logsumexp", # ['sum', 'logsumexp', 'max', 'min', 'CLS'] ) config_semantic = dict( use_char=True, # CharCNN use_biword=True, char_embed_size=100, biword_embed_size=100, pooler_dim=100, use_bert=True, bert_path="./hf_models/chinese-bert-wwm-ext", # bert_path="./hf_models/chinese-lert-base", # bert_path="./hf_models/chinese-macbert-large", ) config_lexicon = dict( fix_embedding=False, # 是否对于外部词典的embedding进行finetune use_char=True, use_biword=True, use_count=True, word_emb_dim=50, biword_emb_dim=50, gaz_embed_dim=50, pooler_dim=100, ) config_radical = dict( radical_feature_dim=100, pooler_dim=100, filter_nums=[50, 30, 20], kernel_sozes=[5, 3, 2], pool_method="max", ) # ====================== CONFIG = dict( config_lexicon=config_lexicon, config_sematic=config_semantic, config_radical=config_radical, config_encoder=config_encoder, config_fuse=config_fuse, ``` # Citation # License The code is released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License for Noncommercial use only. Any commercial use should get formal permission first.