BART is a transformer
encoder-decoder
(seq2seq) model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder. BART is pre-trained by (1) corrupting text with an arbitrary noising function and (2) learning a model to reconstruct the original text.
This model is particularly effective when fine-tuned for text generation tasks (e.g., summarization, translation) but also works well for comprehension tasks (e.g., text classification, question answering).
Training details
Dataset:
Spanish-legal-corpora
- 90% for training / 10% for validation.
from transformers import BartForConditionalGeneration, BartTokenizer
model_id = "mrm8488/bart-legal-base-es"
model = BartForConditionalGeneration.from_pretrained(model_id, forced_bos_token_id=0)
tokenizer = BartTokenizer.from_pretrained(model_id)
deffill_mask_span(text):
batch = tokenizer(text, return_tensors="pt")
generated_ids = model.generate(batch["input_ids"])
print(tokenizer.batch_decode(generated_ids, skip_special_tokens=True))
text = "Los españoles son <mask> ante la ley."
fill_mask_span(text)
# Output: ['Los españoles son iguales ante la ley.1.ª y 2.ª ante la']
text = "Los proyectos de reforma Constitucional deberán <mask> por una mayoría de tres quintos de cada una de las Cámaras."
fill_mask_span(text)
# Output: ['Los proyectos de reforma Constitucional deberán ser aprobados por una mayoría de tres quintos de cada']
Runs of mrm8488 bart-legal-base-es on huggingface.co
56
Total runs
1
24-hour runs
10
3-day runs
23
7-day runs
47
30-day runs
More Information About bart-legal-base-es huggingface.co Model
bart-legal-base-es huggingface.co
bart-legal-base-es huggingface.co is an AI model on huggingface.co that provides bart-legal-base-es's model effect (), which can be used instantly with this mrm8488 bart-legal-base-es model. huggingface.co supports a free trial of the bart-legal-base-es model, and also provides paid use of the bart-legal-base-es. Support call bart-legal-base-es model through api, including Node.js, Python, http.
bart-legal-base-es huggingface.co is an online trial and call api platform, which integrates bart-legal-base-es's modeling effects, including api services, and provides a free online trial of bart-legal-base-es, you can try bart-legal-base-es online for free by clicking the link below.
mrm8488 bart-legal-base-es online free url in huggingface.co:
bart-legal-base-es is an open source model from GitHub that offers a free installation service, and any user can find bart-legal-base-es on GitHub to install. At the same time, huggingface.co provides the effect of bart-legal-base-es install, users can directly use bart-legal-base-es installed effect in huggingface.co for debugging and trial. It also supports api for free installation.