Update README.md
Browse files
README.md
CHANGED
@@ -31,12 +31,56 @@ We report mean classification accuracy across the 260 legal classification tasks
|
|
31 |
|
32 |
## FAQ
|
33 |
|
34 |
-
**What are the Lawma models useful for?** We recommend using the Lawma models only for the legal classification tasks that they models were fine-tuned on. The main take-away of our paper is that specializing models leads to large improvements in performance. Therefore, we strongly recommend practitioners to further fine-tune Lawma on the actual tasks that the models will be used for. Relatively few examples --i.e, dozens or hundreds-- may already lead to large gains in performance.
|
35 |
|
36 |
**What legal classification tasks is Lawma fine-tuned on?** We consider almost all of the variables of the [Supreme Court](http://scdb.wustl.edu/data.php) and [Songer Court of Appeals](www.songerproject.org/us-courts-of-appeals-databases.html) databases. Our reasons to study these legal classification tasks are both technical and substantive. From a technical machine learning perspective, these tasks provide highly non-trivial classification problems where
|
37 |
even the best models leave much room for improvement. From a substantive legal perspective, efficient
|
38 |
solutions to such classification problems have rich and important applications in legal research.
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
## Citation
|
41 |
|
42 |
This model was trained for the project
|
|
|
31 |
|
32 |
## FAQ
|
33 |
|
34 |
+
**What are the Lawma models useful for?** We recommend using the Lawma models only for the legal classification tasks that they models were fine-tuned on. The model has been fine-tuned on multiple-choice questions, not on general instructions. Therefore, the model only outputs multiple choice letters (e.g., A, B, C, etc) or numbers. The main take-away of our paper is that specializing models leads to large improvements in performance. Therefore, we strongly recommend practitioners to further fine-tune Lawma on the actual tasks that the models will be used for. Relatively few examples --i.e, dozens or hundreds-- may already lead to large gains in performance.
|
35 |
|
36 |
**What legal classification tasks is Lawma fine-tuned on?** We consider almost all of the variables of the [Supreme Court](http://scdb.wustl.edu/data.php) and [Songer Court of Appeals](www.songerproject.org/us-courts-of-appeals-databases.html) databases. Our reasons to study these legal classification tasks are both technical and substantive. From a technical machine learning perspective, these tasks provide highly non-trivial classification problems where
|
37 |
even the best models leave much room for improvement. From a substantive legal perspective, efficient
|
38 |
solutions to such classification problems have rich and important applications in legal research.
|
39 |
|
40 |
+
## Example use
|
41 |
+
|
42 |
+
```python
|
43 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
44 |
+
|
45 |
+
model_dir = "ricdomolm/lawma-8b"
|
46 |
+
|
47 |
+
tokenizer = AutoTokenizer.from_pretrained(model_dir)
|
48 |
+
model = AutoModelForCausalLM.from_pretrained(model_dir)
|
49 |
+
|
50 |
+
def generate_response(input_text):
|
51 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
52 |
+
outputs = model.generate(inputs.input_ids, max_length=2048, do_sample=False)
|
53 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
54 |
+
|
55 |
+
return response
|
56 |
+
|
57 |
+
input_text = """This case may seem at first blush too inconsequential to find its way into our bdoks, but the issue it presents is of no small constitutional significance.
|
58 |
+
Appellant Paul Robert Cohen was convicted in the Los Angeles Municipal Court of violating that part of California Penal Code § 415 which prohibits “maliciously and willfully disturb [ing] the peace or quiet of any neighborhood or person. ■.. by... offensive conduct... He was given 30 days’imprisonment. The facts upon which his conviction rests are detailed in the opinion of the Court of Appeal of California, Second Appellate District, as follows:
|
59 |
+
“On April 26, 1968, the defendant was observed in the Los Angeles County Courthouse in the corridor outside of division 20 of the municipal court wearing a jacket bearing the words ‘F the Draft’ which were plainly visible. There were women and children present in the corridor. The defendant was arrested. The defendant testified that he wore the jacket knowing that the words were on the jacket as a means of informing the public of the depth of his feelings against the Vietnam War and the draft.
|
60 |
+
“The defendant did not engage in, nor threaten to engage in, nor did anyone as the result of his conduct in fact commit or threaten to commit any act. of violence. The defendant did not make any loud or unusual noise, nor was there any evidence that he uttered any sound prior to his arrest.” 1 Cal. App. 3d 94, 97-98, 81 Cal. Rptr. 503, 505 (1969).
|
61 |
+
In affirming the conviction the Court of Appeal held that' “offensive conduct” means “behavior which has a tendency to provoke others to acts of violence or to in turn disturb the peace,” and that the State had,proved this element because, on the facts of this case, “[i]t was certainly reasonably foreseeable that.such conduct might cause others to rise up to commit a violent act against the person of the defendant or attempt to forceably remove his jacket.” 1 Cal. App. 3d, at 99-100, 81 Cal.
|
62 |
+
|
63 |
+
Question: What is the issue area of the decision?
|
64 |
+
A. Criminal Procedure
|
65 |
+
B. Civil Rights
|
66 |
+
C. First Amendment
|
67 |
+
D. Due Process
|
68 |
+
E. Privacy
|
69 |
+
F. Attorneys
|
70 |
+
G. Unions
|
71 |
+
H. Economic Activity
|
72 |
+
I. Judicial Power
|
73 |
+
J. Federalism
|
74 |
+
K. Interstate Relations
|
75 |
+
L. Federal Taxation
|
76 |
+
M. Miscellaneous
|
77 |
+
N. Private Action
|
78 |
+
Answer:"""
|
79 |
+
|
80 |
+
output = generate_response(input_text)
|
81 |
+
print(output)
|
82 |
+
```
|
83 |
+
|
84 |
## Citation
|
85 |
|
86 |
This model was trained for the project
|