CoolFace
Modelpublic

yznlp/STRONG-LED-NoStructure

sourceHugging Facemitupdated 1y agoView on Hugging Face
1likes19downloads
README.md81 linesDownload Raw Back to root
1---2license: mit3language:4- en5---6 7# STRONG NoStructure Model Card8 9## Model Information10 11Summary description and a brief definition of inputs and outputs.12 13### Description14 15STRONG-NoStructure is the baseline LED-based model that can produce the summarization of long legal opinions obtained from CanLII.16 17You can also find the **Structure-Controlled** fine-tuned model STRONG-LED [here](https://huggingface.co/yznlp/STRONG-LED).18 19### Usage20 21Below 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.22 23The input includes text of the legal opinion.24 25#### Running the model on a CPU26 27 28```python29from transformers import AutoTokenizer, AutoModelForCausalLM30 31tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")32model = AutoModelForCausalLM.from_pretrained("yznlp/STRONG-LED-NoStructure")33 34input_text = "{Legal Case Content}"35input_ids = tokenizer(input_text, return_tensors="pt")36 37outputs = model.generate(**input_ids, max_length=256, num_beams=4, length_penalty=2.0)38print(tokenizer.decode(outputs[0]))39```40 41 42#### Running the model on a single / multi GPU43 44 45```python46# pip install accelerate47from transformers import AutoTokenizer, AutoModelForCausalLM48 49tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")50model = AutoModelForCausalLM.from_pretrained("yznlp/STRONG-LED-NoStructure", device_map="auto")51 52input_text = "{Legal Case Content}"53input_ids = tokenizer(input_text, return_tensors="pt")54 55outputs = model.generate(**input_ids, max_length=256, num_beams=4, length_penalty=2.0)56print(tokenizer.decode(outputs[0]))57```58 59## Paper Citation60If you find our model useful, please cite61```62@inproceedings{zhong-litman-2023-strong,63    title = "{STRONG} {--} Structure Controllable Legal Opinion Summary Generation",64    author = "Zhong, Yang  and65      Litman, Diane",66    editor = "Park, Jong C.  and67      Arase, Yuki  and68      Hu, Baotian  and69      Lu, Wei  and70      Wijaya, Derry  and71      Purwarianti, Ayu  and72      Krisnadhi, Adila Alfa",73    booktitle = "Findings of the Association for Computational Linguistics: IJCNLP-AACL 2023 (Findings)",74    month = nov,75    year = "2023",76    address = "Nusa Dua, Bali",77    publisher = "Association for Computational Linguistics",78    url = "https://aclanthology.org/2023.findings-ijcnlp.37",79    pages = "431--448",80}81```