Skip to content

codes for paper A Multi-task Learning Model for Chinese-oriented Aspect Polarity Classification and Aspect Term Extraction

License

Notifications You must be signed in to change notification settings

rajae-Bens/LCF-ATEPC

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LCF-ATEPC

codes for our paper A Multi-task Learning Model for Chinese-oriented Aspect Polarity Classification and Aspect Term Extraction

LCF-ATEPC,面向中文及多语言的ATE和APC联合学习模型,基于PyTorch和pytorch-transformers.

LCF-ATEPC, a multi-task learning model for Chinese and multilingual-oriented ATE and APC task, based on PyTorch

LICENSE Contributions welcome PWC

Requirement

  • Python >= 3.7
  • PyTorch >= 1.0
  • pytorch-transformers = 1.2.0 (Package transformers is not recommended for our code)
  • Set use_bert_spc = True to improve the APC performance while only APC is evaluated.

Training

We use the configuration file to manage experiments setting.

Training in batches by experiments configuration file, refer to the experiments.json to manage experiments.

Then,

python train.py --config_path experiments.json

Out of Memory

Since BERT models require a lot of memory. If the out-of-memory problem while training the model, here are the ways to mitigate the problem:

  1. Reduce the training batch size ( train_batch_size = 4 or 8 )
  2. Reduce the longest input sequence ( max_seq_length = 40 or 60 )
  3. Set use_unique_bert = true to use a unique BERT layer to model for both local and global contexts

Model Performance

We made our efforts to make our benchmarks reproducible. However, the performance of the LCF-ATEPC models fluctuates and any slight changes in the model structure could also influence performance. Try different random seed to achieve optimal results.

Performance on Chinese Datasets

chinese

Performance on Multilingual Datasets

multilingual

Optimal Performance on Laptop and Restaurant Datasets

semeval2014

Model Architecture

lcf

Notice

We cleaned up and refactored the original codes for easy understanding and reproduction. However, we didn't test all the training situations for the refactored codes. If you find any issue in this repo, You can raise an issue or submit a pull request, whichever is more convenient for you.

Due to the busy schedule, some module may not update for long term, such as saving and loading module for trained models, inferring module, etc. If possible, we sincerely request for someone to accomplish these work.

Citation

If this repository is helpful to you, please cite our paper:

@misc{yang2019multitask,
    title={A Multi-task Learning Model for Chinese-oriented Aspect Polarity Classification and Aspect Term Extraction},
    author={Heng Yang and Biqing Zeng and JianHao Yang and Youwei Song and Ruyang Xu},
    year={2019},
    eprint={1912.07976},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

Licence

MIT License

About

codes for paper A Multi-task Learning Model for Chinese-oriented Aspect Polarity Classification and Aspect Term Extraction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%