Transformers
Safetensors
English
bart
text2text-generation
keyphrase-generation
sabsab129 commited on
Commit
e1544bb
·
verified ·
1 Parent(s): d7ce47e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +90 -1
README.md CHANGED
@@ -1,3 +1,92 @@
1
  ---
2
- license: cc
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - taln-ls2n/kp20k
5
+ - taln-ls2n/kpbiomed
6
+ - taln-ls2n/kptimes
7
+ language:
8
+ - en
9
+ library_name: transformers
10
+ tags:
11
+ - keyphrase-generation
12
+ base_model:
13
+ - facebook/bart-base
14
  ---
15
+
16
+ # Model Card for BART-base-KP
17
+
18
+ This is a BART-base model for **multi-domain keyphrase generation**, fine-tuned jointly on computer science, biomedical, and news corpora. It serves as a multi-domain seq2seq baseline described in:
19
+
20
+ > Saber Zahhar, Nédra Mellouli, Christophe Rodrigues, Nicolas Travers. *Multi-Domain Keyphrase Prediction via Retrieval-Augmented Ranking: A Resource-Efficient Alternative to Seq2Seq Generation.* DKE 2026.
21
+
22
+ # Model Details
23
+
24
+ ## Model Description
25
+
26
+ We fine-tuned [facebook/bart-base](https://huggingface.co/facebook/bart-base) jointly on the training splits of three multi-domain keyphrase datasets (kp20k, kpbiomed, kptimes) in a **One2Seq** setting: given a source document as input (title and abstract concatenated), the model generates all keyphrases as a single `<KP>`-separated sequence.
27
+
28
+ - **Developed by:** Saber Zahhar (Devoteam / De Vinci Research Center)
29
+ - **Model type:** Conditional language model (seq2seq)
30
+ - **Language(s):** English
31
+ - **License:** Apache 2.0
32
+ - **Parent model:** [facebook/bart-base](https://huggingface.co/facebook/bart-base)
33
+
34
+ # Usage
35
+
36
+ ```python
37
+ from transformers import BartForConditionalGeneration, AutoTokenizer
38
+
39
+ model = BartForConditionalGeneration.from_pretrained('sabsab129/BART-base-KP')
40
+ tokenizer = AutoTokenizer.from_pretrained('sabsab129/BART-base-KP')
41
+
42
+ # inputs are formatted as "title<s>abstract"
43
+ input_text = "BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension<s>We present BART, a denoising autoencoder for pretraining sequence-to-sequence models. BART is trained by (1) corrupting text with an arbitrary noising function, and (2) learning a model to reconstruct the original text. It uses a standard Tranformer-based neural machine translation architecture which, despite its simplicity, can be seen as generalizing BERT (due to the bidirectional encoder), GPT (with the left-to-right decoder), and other recent pretraining schemes. We evaluate a number of noising approaches, finding the best performance by both randomly shuffling the order of sentences and using a novel in-filling scheme, where spans of text are replaced with a single mask token. BART is particularly effective when fine tuned for text generation but also works well for comprehension tasks. It matches the performance of RoBERTa on GLUE and SQuAD, and achieves new state-of-the-art results on a range of abstractive dialogue, question answering, and summarization tasks, with gains of up to 3.5 ROUGE. BART also provides a 1.1 BLEU increase over a back-translation system for machine translation, with only target language pretraining. We also replicate other pretraining schemes within the BART framework, to understand their effect on end-task performance."
44
+ input_ids = tokenizer(input_text, return_tensors="pt")
45
+
46
+ outputs = model.generate(**input_ids, num_beams=7)
47
+ print(tokenizer.decode(outputs[0], skip_special_tokens=False))
48
+ # </s><s>denoising<KP>sequence-to-sequence pre-training<KP>natural language generation<KP>pret</s>
49
+ ```
50
+
51
+ Keyphrases in the output are delimited by `<KP>` tokens.
52
+
53
+
54
+ # Training Details
55
+
56
+ ## Training Data
57
+
58
+ The model was fine-tuned on the concatenated training splits of three multi-domain keyphrase datasets:
59
+
60
+ | Dataset | Domain | Train docs |
61
+ |---|---|---|
62
+ | [kp20k](https://huggingface.co/datasets/taln-ls2n/kp20k) | Computer science (ACM DL, ScienceDirect, Wiley, etc.) | 530.8k |
63
+ | [kpbiomed](https://huggingface.co/datasets/taln-ls2n/kpbiomed) | Biomedical (PubMed) | 500k |
64
+ | [kptimes](https://huggingface.co/datasets/taln-ls2n/kptimes) | News (NYTimes / Japan Times) | 259.9k |
65
+
66
+ Input is the concatenation of a document's title and abstract (formatted as `title<s>abstract`). The encoder caps input at 512 tokens (a threshold exceeded by a subset of kptimes documents).
67
+
68
+ ## Training Procedure
69
+
70
+ Fine-tuning used the **One2Seq** paradigm: all gold keyphrases for a document are concatenated into a single output sequence separated by the `<KP>` special token, ordered **present → absent**, which empirically optimises both extractive and abstractive keyphrase recovery.
71
+
72
+ - **Optimiser:** AdamW, learning rate 5×10⁻⁵
73
+ - **Batch size:** 168
74
+ - **Epochs:** 10
75
+ - **Decoding:** beam search with `num_beams=7`
76
+ - **Hardware:** 1× NVIDIA Tesla V100 32 GB
77
+ - **Wall-clock training time:** ~16 hours
78
+ - **Inference time (60k test documents):** ~4 hours 40 minutes
79
+
80
+
81
+ # Citation
82
+
83
+ If you use this model, please cite the paper:
84
+
85
+ ```bibtex
86
+ @inproceedings{zahhar2026searchkeys,
87
+ title = {Multi-Domain Keyphrase Prediction via Retrieval-Augmented Ranking: A Resource-Efficient Alternative to Seq2Seq Generation},
88
+ author = {Zahhar, Saber and Mellouli, N{\'e}dra and Rodrigues, Christophe and Travers, Nicolas},
89
+ booktitle = {DKE 2026},
90
+ year = {2026}
91
+ }
92
+ ```