Instructions to use duccd/led-base-billsum with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use duccd/led-base-billsum with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("duccd/led-base-billsum") model = AutoModelForSeq2SeqLM.from_pretrained("duccd/led-base-billsum", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
# For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
|
| 3 |
+
# Doc / guide: https://huggingface.co/docs/hub/model-cards
|
| 4 |
+
{}
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
<!-- # Model Card for Model ID -->
|
| 8 |
+
|
| 9 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 10 |
+
|
| 11 |
+
<!-- This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1). -->
|
| 12 |
+
|
| 13 |
+
## Model Details
|
| 14 |
+
|
| 15 |
+
### Model Description
|
| 16 |
+
|
| 17 |
+
<!-- Provide a longer summary of what this model is. -->
|
| 18 |
+
|
| 19 |
+
The Longformer-Encoder-Decoder (LED) model is designed to address the challenge of summarizing lengthy English texts, particularly legal documents. Utilizing a local-global attention mechanism, LED is capable of handling longer input sequences efficiently, making it highly suitable for legal document summarization tasks.
|
| 20 |
+
|
| 21 |
+
- **Developed by:** Duc Dinh Chu
|
| 22 |
+
- **Model type:** LED
|
| 23 |
+
- **Language(s) (NLP):** [More Information Needed]
|
| 24 |
+
- **License:** MIT
|
| 25 |
+
- **Finetuned from model [optional]:** allenai/led-base-16384
|
| 26 |
+
|
| 27 |
+
### Model Sources [optional]
|
| 28 |
+
|
| 29 |
+
<!-- Provide the basic links for the model. -->
|
| 30 |
+
|
| 31 |
+
- **Repository:** [More Information Needed]
|
| 32 |
+
- **Paper [optional]:** [More Information Needed]
|
| 33 |
+
- **Demo [optional]:** [More Information Needed]
|
| 34 |
+
|
| 35 |
+
## Uses
|
| 36 |
+
|
| 37 |
+
The model can be directly used for summarizing lengthy legal documents, extracting key information while reducing the overall length of the text.
|
| 38 |
+
|
| 39 |
+
## How to Get Started with the Model
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
from transformers import LongformerForSequenceClassification, LongformerTokenizer
|
| 43 |
+
|
| 44 |
+
tokenizer = LongformerTokenizer.from_pretrained('')
|
| 45 |
+
model = LongformerForSequenceClassification.from_pretrained('')
|
| 46 |
+
|
| 47 |
+
inputs = tokenizer("Document text to summarize", return_tensors="pt")
|
| 48 |
+
outputs = model(**inputs)
|
| 49 |
+
|
| 50 |
+
## Training Details
|
| 51 |
+
|
| 52 |
+
### Training Data
|
| 53 |
+
|
| 54 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 55 |
+
|
| 56 |
+
The model is trained on the BillSum dataset, which includes structured and domain-specific legal texts from the US Congress and California state bills.
|
| 57 |
+
|
| 58 |
+
### Training Procedure
|
| 59 |
+
|
| 60 |
+
#### Preprocessing [optional]
|
| 61 |
+
|
| 62 |
+
The texts are preprocessed to extract relevant sections and ensure consistency in formatting before being fed into the model.
|
| 63 |
+
|
| 64 |
+
#### Training Hyperparameters
|
| 65 |
+
|
| 66 |
+
Training regime: fp32
|
| 67 |
+
Learning rate: 5e-5
|
| 68 |
+
Epochs: 5
|
| 69 |
+
Batch size: [More Information Needed]
|
| 70 |
+
|
| 71 |
+
## Citation
|
| 72 |
+
|
| 73 |
+
**BibTeX:**
|
| 74 |
+
|
| 75 |
+
@misc{duc2023led,
|
| 76 |
+
author = {Chu Đình Đức},
|
| 77 |
+
title = {Longformer-Encoder-Decoder for Legal Document Summarization},
|
| 78 |
+
year = {2023},
|
| 79 |
+
publisher = {Hugging Face},
|
| 80 |
+
howpublished = {\url{https://huggingface.co/models/duc2023led}}
|
| 81 |
+
}
|