tau / bart-base-sled-contractnli

huggingface.co
Total runs: 22
24-hour runs: 0
7-day runs: 1
30-day runs: 13
Model's Last Updated: 9月 12 2022

Introduction of bart-base-sled-contractnli

Model Details of bart-base-sled-contractnli

BART-SLED (SLiding-Encoder and Decoder, base-sized model)

SLED models use pretrained, short-range encoder-decoder models, and apply them over long-text inputs by splitting the input into multiple overlapping chunks, encoding each independently and perform fusion-in-decoder

Model description

This SLED model is based on the BART model, which is described in its model card . BART is particularly effective when fine-tuned for text generation (e.g. summarization, translation) but also works well for comprehension tasks (e.g. text classification, question answering). When used as a BART-SLED model, it can be applied on long text tasks.

This model was finetuned on the ContractNLI

Intended uses & limitations

You can use the raw model for text infilling. However, the model is mostly meant to be fine-tuned on a supervised dataset.

How to use

To use the model, you first need to install py-sled in your environment (or clone the code from the official repository )

pip install py-sled

For more installation instructions, see here .

Once installed, SLED is fully compatible with HuggingFace's AutoClasses (AutoTokenizer, AutoConfig, AutoModel and AutoModelForCausalLM) and can be loaded using the from_pretrained methods

import sled   # *** required so that SledModels will be registered for the AutoClasses ***
model = AutoModel.from_pretrained('tau/bart-base-sled')

Here is how to use this model in PyTorch:

from sled import SledTokenizer, SledModel
tokenizer = SledTokenizer.from_pretrained('tau/bart-base-sled')
model = SledModel.from_pretrained('tau/bart-base-sled')
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state

You can also replace SledModel by SledModelForConditionalGeneration for Seq2Seq generation

model = SledModelForConditionalGeneration.from_pretrained('tau/bart-base-sled')

In case you wish to apply SLED on a task containing a prefix (e.g. question) which should be given as a context to every chunk, you can pass the prefix_length tensor input as well (A LongTensor in the length of the batch size).

import torch
import sled   # *** required so that SledModels will be registered for the AutoClasses ***
tokenizer = AutoTokenizer.from_pretrained('tau/bart-base-sled')
model = AutoModel.from_pretrained('tau/bart-base-sled')
document_input_ids = tokenizer("Dogs are great for you.", return_tensors="pt").input_ids
prefix_input_ids = tokenizer("Are dogs good for you?", return_tensors="pt").input_ids
input_ids = torch.cat((prefix_input_ids, document_input_ids), dim=-1)
attention_mask = torch.ones_like(input_ids)
prefix_length = torch.LongTensor([[prefix_input_ids.size(1)]])

outputs = model(input_ids=input_ids, attention_mask=attention_mask, prefix_length=prefix_length)
last_hidden_states = outputs.last_hidden_state
BibTeX entry and citation info

Please cite both the SLED paper and the BART paper by Lewis et al as well as ContractNLI by Koreeda and Manning

@inproceedings{Ivgi2022EfficientLU,
  title={Efficient Long-Text Understanding with Short-Text Models},
  author={Maor Ivgi and Uri Shaham and Jonathan Berant},
  year={2022}
}
@article{DBLP:journals/corr/abs-1910-13461,
  author    = {Mike Lewis and
               Yinhan Liu and
               Naman Goyal and
               Marjan Ghazvininejad and
               Abdelrahman Mohamed and
               Omer Levy and
               Veselin Stoyanov and
               Luke Zettlemoyer},
  title     = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
               Generation, Translation, and Comprehension},
  journal   = {CoRR},
  volume    = {abs/1910.13461},
  year      = {2019},
  url       = {http://arxiv.org/abs/1910.13461},
  eprinttype = {arXiv},
  eprint    = {1910.13461},
  timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
@inproceedings{koreeda-manning-2021-contractnli-dataset,
    title = "{C}ontract{NLI}: A Dataset for Document-level Natural Language Inference for Contracts",
    author = "Koreeda, Yuta  and
      Manning, Christopher",
    booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2021",
    month = nov,
    year = "2021",
    address = "Punta Cana, Dominican Republic",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2021.findings-emnlp.164",
    doi = "10.18653/v1/2021.findings-emnlp.164",
    pages = "1907--1919"
}

Runs of tau bart-base-sled-contractnli on huggingface.co

22
Total runs
0
24-hour runs
0
3-day runs
1
7-day runs
13
30-day runs

More Information About bart-base-sled-contractnli huggingface.co Model

More bart-base-sled-contractnli license Visit here:

https://choosealicense.com/licenses/mit

bart-base-sled-contractnli huggingface.co

bart-base-sled-contractnli huggingface.co is an AI model on huggingface.co that provides bart-base-sled-contractnli's model effect (), which can be used instantly with this tau bart-base-sled-contractnli model. huggingface.co supports a free trial of the bart-base-sled-contractnli model, and also provides paid use of the bart-base-sled-contractnli. Support call bart-base-sled-contractnli model through api, including Node.js, Python, http.

bart-base-sled-contractnli huggingface.co Url

https://huggingface.co/tau/bart-base-sled-contractnli

tau bart-base-sled-contractnli online free

bart-base-sled-contractnli huggingface.co is an online trial and call api platform, which integrates bart-base-sled-contractnli's modeling effects, including api services, and provides a free online trial of bart-base-sled-contractnli, you can try bart-base-sled-contractnli online for free by clicking the link below.

tau bart-base-sled-contractnli online free url in huggingface.co:

https://huggingface.co/tau/bart-base-sled-contractnli

bart-base-sled-contractnli install

bart-base-sled-contractnli is an open source model from GitHub that offers a free installation service, and any user can find bart-base-sled-contractnli on GitHub to install. At the same time, huggingface.co provides the effect of bart-base-sled-contractnli install, users can directly use bart-base-sled-contractnli installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

bart-base-sled-contractnli install url in huggingface.co:

https://huggingface.co/tau/bart-base-sled-contractnli

Url of bart-base-sled-contractnli

bart-base-sled-contractnli huggingface.co Url

Provider of bart-base-sled-contractnli huggingface.co

tau
ORGANIZATIONS

Other API from tau

huggingface.co

Total runs: 28.8K
Run Growth: 27.0K
Growth Rate: 93.85%
Updated:8月 17 2021
huggingface.co

Total runs: 448
Run Growth: 341
Growth Rate: 76.12%
Updated:8月 10 2022
huggingface.co

Total runs: 60
Run Growth: 0
Growth Rate: 0.00%
Updated:2月 09 2022
huggingface.co

Total runs: 17
Run Growth: 10
Growth Rate: 58.82%
Updated:8月 17 2021
huggingface.co

Total runs: 12
Run Growth: 2
Growth Rate: 16.67%
Updated:8月 10 2022
huggingface.co

Total runs: 7
Run Growth: 4
Growth Rate: 57.14%
Updated:3月 07 2022
huggingface.co

Total runs: 5
Run Growth: 0
Growth Rate: 0.00%
Updated:4月 09 2022
huggingface.co

Total runs: 3
Run Growth: 0
Growth Rate: 0.00%
Updated:4月 09 2022
huggingface.co

Total runs: 3
Run Growth: 0
Growth Rate: 0.00%
Updated:3月 14 2022
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:3月 07 2022
huggingface.co

Total runs: 0
Run Growth: -7
Growth Rate: 0.00%
Updated:5月 08 2022
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:10月 21 2021