← 开源
maszhongming

MatchSum

Code for ACL 2020 paper: "Extractive Summarization as Text Matching"

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
520
Star
105
Fork
+0
本周
0
贡献者
创建于 2020-04-13 · 更新于 2026-07-03 · 今日第 17858 名

maszhongming/MatchSum 排名第 17,858,有 520 个星标。

同类别比较

maszhongming/MatchSum 排名第 17,858,此处有 8 个同类条目;CuriousAI/ladder 排名第 17,864。

同类别比较
名称排名指标
Deeachain/Segmentation-Pytorch17,844
语言:
Python
星标数:
520
分叉数:
75
简介:
Semantic Segmentation in Pytorch. Network include: FCN、FCN_ResNet、SegNet、UNet、BiSeNet、BiSeNetV2、PSPNet、DeepLabv3_plus、 HRNet、DDRNet
OpenDriveLab/WorldEngine17,846
语言:
Python
星标数:
520
分叉数:
34
简介:
WorldEngine: Towards the Era of Post-Training for Autonomous Driving
TellinaTool/nl2bash17,847
语言:
NewLisp
星标数:
520
分叉数:
69
简介:
Generating bash command from natural language https://arxiv.org/abs/1802.08979
XingangPan/deep-generative-prior17,848
语言:
Python
星标数:
520
分叉数:
69
简介:
Code for deep generative prior (ECCV2020 oral)
CuriousAI/ladder17,864
语言:
Python
星标数:
519
分叉数:
141
简介:
Ladder network is a deep learning algorithm that combines supervised and unsupervised learning
attentionmech/mav17,872
语言:
Python
星标数:
519
分叉数:
40
简介:
Model Activity Visualiser
jsn5/dancenet17,875
语言:
Python
星标数:
519
分叉数:
82
简介:
DanceNet -💃💃Dance generator using Autoencoder, LSTM and Mixture Density Network. (Keras)
sshaoshuai/Pointnet2.PyTorch17,880
语言:
Python
星标数:
519
分叉数:
107
简介:
A faster implementation of PointNet++ based on PyTorch.
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
关键词Summarization
星标数520
分叉数105
贡献者0
创建日期2020-04-13
更新日期2026-07-03
1 天星标数0
7 天星标数0
排名17,858
上次排名17,642
排名变化-216
7 天星标排名16,335
上次 7 天星标排名16,344
7 天星标排名变化9
总星标排名18,786
上次总星标排名18,763
总星标排名变化-23
国家USA
README 摘录

MatchSum Code for ACL 2020 paper: *Extractive Summarization as Text Matching* Dependencies Python 3. 1 All code only supports running on Linux. Data We have already processed CNN/DailyMail dataset, you can download it through this link, unzip and move it to . It contains two versions (BERT/RoBERTa) of the dataset, a total of six files. In addition, we have released five other processed datasets (WikiHow, PubMed, XSum, MultiNews, Reddit), which you can find here. Train We use eight Tesla

-V100-16G GPUs to train our model, the training time is about 30 hours. If you do not have enough video memory, you can reduce the *batch_size* or *candidate_num* in , or you can adjust *max_len* in . You can choose BERT or RoBERTa as the encoder of **MatchSum**, for example, to train a RoBERTa model, you can run the following command: Test After completing the training process, several best checkpoints are stored in a folder named after the

training start time, for example, . You can run the following command to get the results on test set (only one GPU is required for testing): The ROUGE score will be printed on the screen, and the output of the model will be stored in the folder . 55 | Generated Summaries The summaries generated by our models on the CNN/DM dataset can be found here. In the version we released, the result of **MatchSum(BERT)** is 44. 40 (R-1/R

-2/R-L), and the result of **MatchSum(RoBERTa)** is 44. The summaries generated on other datasets can be found here. Pretrained Model Two versions of the pre-trained model on CNN/DM are available here. For example, Besides, the pre-trained models on other datasets can be found here. Process Your Own Data If you want to process your own data and get candidate summaries for each document, first you need to convert your dataset to the same *jsonl

* format as ours, and make sure to include *text* and *summary* fields. Second, you should use BertExt or other methods to select some important sentences from each document and get an *index. jsonl* file (we provide an example in ). Then you can run the following command: Please fill your ROUGE path in line 22 before running this command. It is worth noting that you need to adjust the number of candidate summaries and the number of sentences in the candidate

summaries according to your dataset. After processing the dataset, and before using our code to train your own model, please adjust *candidate_num* in and *max_len* in according to the number and the length of the candidate summaries in your dataset. Note The code and data released here are used for the matching model. Before the matching stage, we use BertExt to prune meaningless candidate summaries, the implementation of BertExt can refer to PreSumm.

常见问题

记录了多少星标和分叉?

maszhongming/MatchSum 有 520 个星标和 105 个分叉。

仓库排名是多少?

maszhongming/MatchSum 排名第 17,858。

记录的语言和类别是什么?

maszhongming/MatchSum 有 520 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

maszhongming/MatchSum 与 CuriousAI/ladder 比较,后者排名第 17,864,有 519 个星标。

README

MatchSum

Code for ACL 2020 paper: Extractive Summarization as Text Matching

Dependencies

All code only supports running on Linux.

Data

We have already processed CNN/DailyMail dataset, you can download it through this link, unzip and move it to ./data. It contains two versions (BERT/RoBERTa) of the dataset, a total of six files.

In addition, we have released five other processed datasets (WikiHow, PubMed, XSum, MultiNews, Reddit), which you can find here.

Train

We use eight Tesla-V100-16G GPUs to train our model, the training time is about 30 hours. If you do not have enough video memory, you can reduce the batch_size or candidate_num in train_matching.py, or you can adjust max_len in dataloader.py.

You can choose BERT or RoBERTa as the encoder of MatchSum, for example, to train a RoBERTa model, you can run the following command:

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python train_matching.py --mode=train --encoder=roberta --save_path=./roberta --gpus=0,1,2,3,4,5,6,7

Test

After completing the training process, several best checkpoints are stored in a folder named after the training start time, for example, ./roberta/2020-04-12-09-24-51. You can run the following command to get the results on test set (only one GPU is required for testing):

CUDA_VISIBLE_DEVICES=0 python train_matching.py --mode=test --encoder=roberta --save_path=./roberta/2020-04-12-09-24-51/ --gpus=0

The ROUGE score will be printed on the screen, and the output of the model will be stored in the folder ./roberta/result.

Results on CNN/DailyMail

Test set (the average of three runs)

Model R-1 R-2 R-L
MatchSum (BERT-base) 44.22 20.62 40.38
MatchSum (RoBERTa-base) 44.41 20.86 40.55

Generated Summaries

The summaries generated by our models on the CNN/DM dataset can be found here. In the version we released, the result of MatchSum(BERT) is 44.26/20.58/40.40 (R-1/R-2/R-L), and the result of MatchSum(RoBERTa) is 44.45/20.88/40.60.

The summaries generated on other datasets can be found here.

Pretrained Model

Two versions of the pre-trained model on CNN/DM are available here. You can use them through torch.load. For example,

model = torch.load('MatchSum_cnndm_bert.ckpt')

Besides, the pre-trained models on other datasets can be found here.

Process Your Own Data

If you want to process your own data and get candidate summaries for each document, first you need to convert your dataset to the same jsonl format as ours, and make sure to include text and summary fields. Second, you should use BertExt or other methods to select some important sentences from each document and get an index.jsonl file (we provide an example in ./preprocess/test_cnndm.jsonl).

Then you can run the following command:

python get_candidate.py --tokenizer=bert --data_path=/path/to/your_original_data.jsonl --index_path=/path/to/your_index.jsonl --write_path=/path/to/store/your_processed_data.jsonl

Please fill your ROUGE path in preprocess/get_candidate.py line 22 before running this command. It is worth noting that you need to adjust the number of candidate summaries and the number of sentences in the candidate summaries according to your dataset. For details, see line 89-97 in preprocess/get_candidate.py.

After processing the dataset, and before using our code to train your own model, please adjust candidate_num in train_matching.py and max_len in dataloader.py according to the number and the length of the candidate summaries in your dataset.

Note

The code and data released here are used for the matching model. Before the matching stage, we use BertExt to prune meaningless candidate summaries, the implementation of BertExt can refer to PreSumm.

排名相邻
同类项目