LEAR
The implementation our EMNLP 2021 paper "Enhanced Language Representation with Label Knowledge for Span Extraction".
**The code is in the "master" branch. I will re-organize the code when I am free.
The implementation our EMNLP 2021 paper "Enhanced Language Representation with Label Knowledge for Span Extraction".
**The code is in the "master" branch. I will re-organize the code when I am free.
同学你好,
我根据论文,使用以下参数运行
CUDA_VISIBLE_DEVICES=0 python run_ner.py --task_type sequence_classification --task_save_name SERS --data_dir ./data/ner --data_name zh_onto4 --model_name SERS --model_name_or_path ../bert_models/chinese-roberta-wwm-ext-large --output_dir ./zh_onto4_models/bert_large --do_lower_case False --result_dir ./zh_onto4_models/results --first_label_file ./data/ner/zh_onto4/processed/label_map.json --overwrite_output_dir True --train_set ./data/ner/zh_onto4/processed/train.json --dev_set ./data/ner/zh_onto4/processed/dev.json --test_set ./data/ner/zh_onto4/processed/test.json --is_chinese True --max_seq_length 128 --per_gpu_train_batch_size 32 --gradient_accumulation_steps 1 --num_train_epochs 5 --learning_rate 8e-6 --task_layer_lr 10 --label_str_file ./data/ner/zh_onto4/processed/label_annotation.txt --span_decode_strategy v5
在Ontonote4 Chinese上得到 f1: 82.32,与论文上报告的82.95有一些差距,请问这个数值是合理的吗,还是我有运行参数设置不对?
期待您的回复! 叶德铭
Hi~
Training: 0%| | 0/1159 [00:22<?, ?it/s]
Traceback (most recent call last):
File "run_trigger_extraction.py", line 405, in <module>
main()
File "run_trigger_extraction.py", line 378, in main
train(args, model, processor)
File "run_trigger_extraction.py", line 243, in train
pred_sub_heads, pred_sub_tails = model(data, add_label_info=add_label_info)
File "/home/yc21/software/anaconda3/envs/lear/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/yc21/software/anaconda3/envs/lear/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 168, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/home/yc21/software/anaconda3/envs/lear/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 178, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/home/yc21/software/anaconda3/envs/lear/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 86, in parallel_apply
output.reraise()
File "/home/yc21/software/anaconda3/envs/lear/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
RuntimeError: Caught RuntimeError in replica 0 on device 0.
Original Traceback (most recent call last):
File "/home/yc21/software/anaconda3/envs/lear/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 61, in _worker
output = module(*input, **kwargs)
File "/home/yc21/software/anaconda3/envs/lear/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/yc21/project/LEAR/models/model_event.py", line 635, in forward
fused_results = self.label_fusing_layer(
File "/home/yc21/software/anaconda3/envs/lear/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/yc21/project/LEAR/utils/model_utils.py", line 320, in forward
return self.get_fused_feature_with_attn(token_embs, label_embs, input_mask, label_input_mask, return_scores=return_scores)
File "/home/yc21/project/LEAR/utils/model_utils.py", line 504, in get_fused_feature_with_attn
scores = torch.matmul(token_feature_fc, label_feature_t).view(
RuntimeError: shape '[4, 48, 33, -1]' is invalid for input of size 160512
谢谢大家~
可以参考您进行ner时候传的参数吗 python run_ner.py --task_type sequence_classification --task_save_name FLAT_NER --data_dir ./data/data/ner --data_name zh_msra --model_name bert_ner --model_name_or_path bert-base-cased --output_dir ./model --do_lower_case False --result_dir ./model/result --first_label_file ./data/data/ner/zh_msra/processed/label_map.json --overwrite_output_dir TRUE --train_set ./data/data/ner/zh_msra/processed/train.json --dev_set ./data/data/ner/zh_msra/processed/dev.json --test_set ./data/data/ner/zh_msra/processed/test.json
Hi~in your paper, you show us a picture which indicates the non-effective attention mechanism of previous models:
I am wondering whether you can show us a picture like the above picture to demonstrate the effectiveness of LEAR's attention mechanism? Thank you~
Hi, LEAR is an excellent work. I have encountered some problems with the loss when running the code. The loss is oscillating without convergence. I wonder if you have any ideas about it. Thank you.
Regards, Chuck
Aspect Sentiment Quad Prediction (ASQP) This repo contains the annotated data and code for our paper Aspect Sentiment Quad Prediction as Paraphrase Ge
SentiLARE: Sentiment-Aware Language Representation Learning with Linguistic Knowledge Introduction SentiLARE is a sentiment-aware pre-trained language
MultiModal-InfoMax This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Informa
Interactive Machine Comprehension with Dynamic Knowledge Graphs Implementation for the EMNLP 2021 paper. Dependencies apt-get -y update apt-get instal
STaCK: Sentence Ordering with Temporal Commonsense Knowledge This repository contains the pytorch implementation of the paper STaCK: Sentence Ordering
Pytorch implementation of paper "Efficient Nearest Neighbor Language Models" (EMNLP 2021)
Adam-NSCL This is a PyTorch implementation of Adam-NSCL algorithm for continual learning from our CVPR2021 (oral) paper: Title: Training Networks in N
Towards Persona-Based Empathetic Conversational Models (PEC) This is the repo for our work "Towards Persona-Based Empathetic Conversational Models" (E
ToxiChat Code and data for the EMNLP 2021 paper "Just Say No: Analyzing the Stance of Neural Dialogue Generation in Offensive Contexts". Install depen
Vision Guided Generative Pre-trained Language Models for Multimodal Abstractive Summarization [Paper] accepted at the EMNLP 2021: Vision Guided Genera
Contra-OOD Code for EMNLP 2021 paper Contrastive Out-of-Distribution Detection for Pretrained Transformers. Requirements PyTorch Transformers datasets
Text-AutoAugment (TAA) This repository contains the code for our paper Text AutoAugment: Learning Compositional Augmentation Policy for Text Classific
Learning Opinion Summarizers by Selecting Informative Reviews This repository contains the codebase and the dataset for the corresponding EMNLP 2021
Don’t be Contradicted with Anything!CI-ToD: Towards Benchmarking Consistency for Task-oriented Dialogue System This repository contains the PyTorch im
PyTorch code for EMNLP 2021 paper: Don't be Contradicted with Anything! CI-ToD: Towards Benchmarking Consistency for Task-oriented Dialogue System
Connect-the-Dots: Bridging Semantics between Words and Definitions via Aligning Word Sense Inventories This repo is the code release of EMNLP 2021 con
This repository contains data and code for our EMNLP 2021 paper Models and Datasets for Cross-Lingual Summarisation. Please contact me at [email protected]
Path-Generator-QA This is a Pytorch implementation for the EMNLP 2020 (Findings) paper: Connecting the Dots: A Knowledgeable Path Generator for Common
Language Emergence in Multi Agent Dialog Code for the Paper Natural Language Does Not Emerge 'Naturally' in Multi-Agent Dialog Satwik Kottur, José M.