Edit model card

STRONG NoStructure Model Card

Model Information

Summary description and a brief definition of inputs and outputs.

Description

STRONG-NoStructure is the baseline LED-based model that can produce the summarization of long legal opinions obtained from CanLII.

You can also find the Structure-Controlled fine-tuned model STRONG-LED here.

Usage

Below we share some code snippets on how to get quickly started with running the model. First make sure to pip install -U transformers, then copy the snippet from the section that is relevant for your usecase.

The input includes text of the legal opinion.

Running the model on a CPU

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
model = AutoModelForCausalLM.from_pretrained("yznlp/STRONG-LED-NoStructure")

input_text = "{Legal Case Content}"
input_ids = tokenizer(input_text, return_tensors="pt")

outputs = model.generate(**input_ids, max_length=256, num_beams=4, length_penalty=2.0)
print(tokenizer.decode(outputs[0]))

Running the model on a single / multi GPU

# pip install accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
model = AutoModelForCausalLM.from_pretrained("yznlp/STRONG-LED-NoStructure", device_map="auto")

input_text = "{Legal Case Content}"
input_ids = tokenizer(input_text, return_tensors="pt")

outputs = model.generate(**input_ids, max_length=256, num_beams=4, length_penalty=2.0)
print(tokenizer.decode(outputs[0]))

Paper Citation

If you find our model useful, please cite

@inproceedings{zhong-litman-2023-strong,
    title = "{STRONG} {--} Structure Controllable Legal Opinion Summary Generation",
    author = "Zhong, Yang  and
      Litman, Diane",
    editor = "Park, Jong C.  and
      Arase, Yuki  and
      Hu, Baotian  and
      Lu, Wei  and
      Wijaya, Derry  and
      Purwarianti, Ayu  and
      Krisnadhi, Adila Alfa",
    booktitle = "Findings of the Association for Computational Linguistics: IJCNLP-AACL 2023 (Findings)",
    month = nov,
    year = "2023",
    address = "Nusa Dua, Bali",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.findings-ijcnlp.37",
    pages = "431--448",
}
Downloads last month
14
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Collection including yznlp/STRONG-LED-NoStructure