https://github.com/thinkwee/co2sum
code for paper "Co2sum: contrastive learning for factual-consistent abstractive summarization"
https://github.com/thinkwee/co2sum
Last synced: about 2 months ago
JSON representation
code for paper "Co2sum: contrastive learning for factual-consistent abstractive summarization"
- Host: GitHub
- URL: https://github.com/thinkwee/co2sum
- Owner: thinkwee
- Created: 2023-08-15T06:45:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-15T06:46:39.000Z (almost 2 years ago)
- Last Synced: 2025-02-14T11:33:36.006Z (3 months ago)
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CO2Sum
- Code for the paper [CO2Sum:Contrastive Learning for Factual-Consistent Abstractive Summarization](https://arxiv.org/pdf/2112.01147.pdf)
- Include the negative sample constuction method LFN CO2Sum_LFN, and the training code CO2Sum_train## CO2Sum_LFN
- Code for the LFN algorithm introduced in the paper
- The process of LFN consists of three steps:
- run get_next.py to get the context of summary
- run ./LFN_LM/run.sh to get the fact fragments based on the article, summary and context
- run LFN_construct.py to construct the negative samples based on the fact fragments## CO2Sum_train
- We develop our method based on the fairseq. Since there is no model architecture modified, you can just extend the criterion, data, tasks by setting --user-dir to CO2Sum_train then start training and inference by using default fairseq-train and fairseq-generate
- The loss function of CoEnc and CoDec are described in the ./criterions/label_smoothed_cross_entropy_with_position_triplet_contrastive.py
- The data loading process for ground truth summary and negative samples is described in ./data/language_position_triplet_dataset.py