Downloads · 30 days
105
4% of all-time downloads
taln-ls2n/bart-large-kp20k
bart-large-kp20k is a machine learning model from taln-ls2n. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This is a BART-large model for keyphrase generation.
Downloads · 30 days
105
4% of all-time downloads
All-time downloads
3K
Public
Repo size
4.9 GB
Likes
0
Public
Click a slice to open those files.
.bin1.6 GB · 100%
From the Hugging Face model README
This is a BART-large model for keyphrase generation.
This is a BART-large model for keyphrase generation. We specifically, we fine-tuned bart-large on the KP20k dataset in a ONE2MANY setting, that is, given a source text as input, the task is to generate keyphrases as a single sequence of delimiter-separated phrases. During fine-tuning, gold keyphrases are arranged in the present-absent order which was found to give the best results.
from transformers import BartForConditionalGeneration, AutoTokenizer
model = BartForConditionalGeneration.from_pretrained('taln-ls2n/bart-large-kp20k')
tokenizer = AutoTokenizer.from_pretrained('taln-ls2n/bart-large-kp20k')
# inputs are formatted as "title<s>abstract"
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."
input_ids = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**input_ids)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# denoising;natural language generation;machine translation;sequence-to-sequence training
Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al. (2021) and Bender et al. (2021)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.
This model was fine-tuned on the training split of the KP20k dataset.
We fine-tuned bart-large on the training split of the KP20k dataset in a ONE2MANY setting, that is, given a source text as input, the task is to generate keyphrases as a single sequence of delimiter-separated phrases. During fine-tuning, gold keyphrases are arranged in the present-absent order which was found to give the best results. The model was trained for 10 epochs, and the checkpoint that performs best on the dev split was selected (epoch 9).
We evaluate the performance of this model on the test split of the KP20K dataset in terms of \(F_1\) score using exact match between gold and predicted keyphrases. Stemming (Porter stemmer) is applied to reduce the number of mismatches and duplicates are removed. We compute the scores both at the top-k predicted keyphrases with \(k \in 5, 10\), and at the number \(M\) of keyphrases predicted by the models. For \(F_1@k\) scores, if the number of predicted keyphrases is below \(k\), we append incorrect predictions until it reaches exactly \(k\) keyphrases. We also report scores for present and absent keyphrases separately to get more insights about the extractive and generative capabilities of the model.
| Eval | \(F_1@M\) | \(F_1@5\) | \(F_1@10\) |
|---|---|---|---|
| all | 30.8 | 29.9 | 27.2 |
| present | 39.9 | 37.7 | 30.4 |
| absent | 4.5 | 8.2 | 8.0 |
Experiments were conducted using a private infrastructure, which has a carbon efficiency of 0.432 kgCO2eq/kWh. A cumulative of 410 hours of computation was performed on hardware of type RTX 2080 Ti (TDP of 250W).
Total emissions are estimated to be 44.28 kgCO2eq of which 0 percents were directly offset.
Estimations were conducted using the Machine Learning Impact calculator presented in Lacoste et al. (2019).