yznlp commited on
Commit
3805bdd
·
verified ·
1 Parent(s): 98612d2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +78 -0
README.md CHANGED
@@ -1,3 +1,81 @@
1
  ---
2
  license: mit
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ language:
4
+ - en
5
  ---
6
+
7
+ # STRONG NoStructure Model Card
8
+
9
+ ## Model Information
10
+
11
+ Summary description and a brief definition of inputs and outputs.
12
+
13
+ ### Description
14
+
15
+ STRONG-NoStructure is the baseline LED-based model that can produce a structure-controllable summarization of long legal opinions obtained from CanLII.
16
+
17
+ You can also find the structure-controlled fine-tuned model [here](https://huggingface.co/yznlp/STRONG-LED).
18
+
19
+ ### Usage
20
+
21
+ 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.
22
+
23
+ The input includes text of the legal opinion.
24
+
25
+ #### Running the model on a CPU
26
+
27
+
28
+ ```python
29
+ from transformers import AutoTokenizer, AutoModelForCausalLM
30
+
31
+ tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
32
+ model = AutoModelForCausalLM.from_pretrained("yznlp/STRONG-LED-NoStructure")
33
+
34
+ input_text = "{Legal Case Content}"
35
+ input_ids = tokenizer(input_text, return_tensors="pt")
36
+
37
+ outputs = model.generate(**input_ids, max_length=256, num_beams=4, length_penalty=2.0)
38
+ print(tokenizer.decode(outputs[0]))
39
+ ```
40
+
41
+
42
+ #### Running the model on a single / multi GPU
43
+
44
+
45
+ ```python
46
+ # pip install accelerate
47
+ from transformers import AutoTokenizer, AutoModelForCausalLM
48
+
49
+ tokenizer = AutoTokenizer.from_pretrained("allenai/led-base-16384")
50
+ model = AutoModelForCausalLM.from_pretrained("yznlp/STRONG-LED-NoStructure", device_map="auto")
51
+
52
+ input_text = "{Legal Case Content}"
53
+ input_ids = tokenizer(input_text, return_tensors="pt")
54
+
55
+ outputs = model.generate(**input_ids, max_length=256, num_beams=4, length_penalty=2.0)
56
+ print(tokenizer.decode(outputs[0]))
57
+ ```
58
+
59
+ ## Paper Citation
60
+ If you find our model useful, please cite
61
+ ```
62
+ @inproceedings{zhong-litman-2023-strong,
63
+ title = "{STRONG} {--} Structure Controllable Legal Opinion Summary Generation",
64
+ author = "Zhong, Yang and
65
+ Litman, Diane",
66
+ editor = "Park, Jong C. and
67
+ Arase, Yuki and
68
+ Hu, Baotian and
69
+ Lu, Wei and
70
+ Wijaya, Derry and
71
+ Purwarianti, Ayu and
72
+ 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
+ ```