Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
task_categories:
|
4 |
+
- text-classification
|
5 |
+
- text-generation
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
tags:
|
9 |
+
- legal
|
10 |
+
- legal-reasoning
|
11 |
+
- multiple-choice
|
12 |
+
- regression
|
13 |
+
pretty_name: LegalBench Processed by DatologyAI
|
14 |
+
size_categories:
|
15 |
+
- 1K<n<10K
|
16 |
+
---
|
17 |
+
|
18 |
+
# DatologyAI/legalbench
|
19 |
+
|
20 |
+
## Overview
|
21 |
+
This dataset contains 26 legal reasoning tasks from [LegalBench](https://github.com/HazyResearch/legalbench), processed for easy use in language model evaluation. Each task preserves its original data and includes an additional `input` column with a formatted prompt, generated using the LegalBench registry, ready to be fed directly into language models.
|
22 |
+
|
23 |
+
## Task Categories
|
24 |
+
|
25 |
+
- **Basic Legal**: `canada_tax_court_outcomes`, `jcrew_blocker`, `learned_hands_benefits`, `telemarketing_sales_rule`
|
26 |
+
- **Citation**: `citation_prediction_classification`
|
27 |
+
- **Diversity Analysis**: `diversity_3`, `diversity_5`, `diversity_6`
|
28 |
+
- **Jurisdiction**: `personal_jurisdiction`
|
29 |
+
- **SARA Analysis**: `sara_entailment`, `sara_numeric`
|
30 |
+
- **Supply Chain Disclosure**: `supply_chain_disclosure_best_practice_accountability`, `supply_chain_disclosure_best_practice_certification`, `supply_chain_disclosure_best_practice_training`
|
31 |
+
- **MAUD Contract Analysis**: `maud_ability_to_consummate_concept_is_subject_to_mae_carveouts`, `maud_additional_matching_rights_period_for_modifications_cor`, `maud_change_in_law_subject_to_disproportionate_impact_modifier`, `maud_changes_in_gaap_or_other_accounting_principles_subject_to_disproportionate_impact_modifier`, `maud_cor_permitted_in_response_to_intervening_event`, `maud_fls_mae_standard`, `maud_includes_consistent_with_past_practice`, `maud_initial_matching_rights_period_cor`, `maud_ordinary_course_efforts_standard`, `maud_pandemic_or_other_public_health_event_subject_to_disproportionate_impact_modifier`, `maud_pandemic_or_other_public_health_event_specific_reference_to_pandemic_related_governmental_responses_or_measures`, `maud_type_of_consideration`
|
32 |
+
|
33 |
+
## Task Details
|
34 |
+
|
35 |
+
<div style="overflow-x: auto; max-height: 400px; border: 1px solid #ddd;">
|
36 |
+
<table>
|
37 |
+
<thead>
|
38 |
+
<tr>
|
39 |
+
<th>Task Name</th>
|
40 |
+
<th>Type</th>
|
41 |
+
<th>Description</th>
|
42 |
+
</tr>
|
43 |
+
</thead>
|
44 |
+
<tbody>
|
45 |
+
<tr><td>canada\_tax\_court\_outcomes</td><td>multiple_choice</td><td>INSTRUCTIONS: Indicate whether the following judgment excerpt from a Tax Court of Canada decision allows the appeal or dismisses the appeal. Where the result is mixed, indicate that the appeal was allowed. Ignore costs orders. Where the outcome is unclear indicate other.<br>Options: allowed, dismissed, other</td></tr>
|
46 |
+
<tr><td>citation\_prediction\_classification</td><td>multiple_choice</td><td>Can the case can be used as a citation for the provided text?</td></tr>
|
47 |
+
<tr><td>diversity\_3</td><td>multiple_choice</td><td>Diversity jurisdiction exists when there is (1) complete diversity between plaintiffs and defendants, and (2) the amount-in-controversy (AiC) is greater than $75k.</td></tr>
|
48 |
+
<tr><td>diversity\_5</td><td>multiple_choice</td><td>Diversity jurisdiction exists when there is (1) complete diversity between plaintiffs and defendants, and (2) the amount-in-controversy (AiC) is greater than $75k.</td></tr>
|
49 |
+
<tr><td>diversity\_6</td><td>multiple_choice</td><td>Diversity jurisdiction exists when there is (1) complete diversity between plaintiffs and defendants, and (2) the amount-in-controversy (AiC) is greater than $75k.</td></tr>
|
50 |
+
<tr><td>jcrew\_blocker</td><td>multiple_choice</td><td>The JCrew Blocker is a provision that typically includes (1) a prohibition on the borrower from transferring IP to an unrestricted subsidiary, and (2) a requirement that the borrower obtains the consent of its agent/lenders before transferring IP to any subsidiary. Do the following provisions contain JCrew Blockers?</td></tr>
|
51 |
+
<tr><td>learned\_hands\_benefits</td><td>multiple_choice</td><td>Does the post discuss public benefits and social services that people can get from the government, like for food, disability, old age, housing, medical help, unemployment, child care, or other social needs?</td></tr>
|
52 |
+
<tr><td>maud\_ability\_to\_consummate\_concept\_is\_subject\_to\_mae\_carveouts</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: Is the 'ability to consummate' concept subject to Material Adverse Effect (MAE) carveouts?<br>Option A: No<br>Option B: Yes</td></tr>
|
53 |
+
<tr><td>maud\_additional\_matching\_rights\_period\_for\_modifications\_cor</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: How long is the additional matching rights period for modifications in case the board changes its recommendation?<br>Option A: 2 business days or less<br>Option B: 3 business days<br>Option C: 3 days<br>Option D: 4 business days<br>Option E: 5 business days<br>Option F: > 5 business days<br>Option G: None</td></tr>
|
54 |
+
<tr><td>maud\_change\_in\_law\_subject\_to\_disproportionate\_impact\_modifier</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: Do changes in law that have disproportionate impact qualify for Material Adverse Effect (MAE)?<br>Option A: No<br>Option B: Yes</td></tr>
|
55 |
+
<tr><td>maud\_changes\_in\_gaap\_or\_other\_accounting\_principles\_subject\_to\_disproportionate\_impact\_modifier</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: Do changes in GAAP or other accounting principles that have disproportionate impact qualify for Material Adverse Effect (MAE)?<br>Option A: No<br>Option B: Yes</td></tr>
|
56 |
+
<tr><td>maud\_cor\_permitted\_in\_response\_to\_intervening\_event</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: Is Change of Recommendation permitted in response to an intervening event?<br>Option A: No<br>Option B: Yes</td></tr>
|
57 |
+
<tr><td>maud\_fls\_mae\_standard</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: What is the Forward Looking Standard (FLS) with respect to Material Adverse Effect (MAE)?<br>Option A: "Could" (reasonably) be expected to<br>Option B: "Would"<br>Option C: "Would" (reasonably) be expected to<br>Option D: No<br>Option E: Other forward-looking standard</td></tr>
|
58 |
+
<tr><td>maud\_includes\_consistent\_with\_past\_practice</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: Does the wording of the Efforts Covenant clause include 'consistent with past practice'?<br>Option A: No<br>Option B: Yes</td></tr>
|
59 |
+
<tr><td>maud\_initial\_matching\_rights\_period\_cor</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: How long is the initial matching rights period in case the board changes its recommendation?<br>Option A: 2 business days or less<br>Option B: 3 business days<br>Option C: 3 calendar days<br>Option D: 4 business days<br>Option E: 4 calendar days<br>Option F: 5 business days<br>Option G: Greater than 5 business days</td></tr>
|
60 |
+
<tr><td>maud\_ordinary\_course\_efforts\_standard</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: What is the efforts standard?<br>Option A: Commercially reasonable efforts<br>Option B: Flat covenant (no efforts standard)<br>Option C: Reasonable best efforts</td></tr>
|
61 |
+
<tr><td>maud\_pandemic\_or\_other\_public\_health\_event\_subject\_to\_disproportionate\_impact\_modifier</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: Do pandemics or other public health events have to have disproportionate impact to qualify for Material Adverse Effect (MAE)?<br>Option A: No<br>Option B: Yes</td></tr>
|
62 |
+
<tr><td>maud\_pandemic\_or\_other\_public\_health\_event\_specific\_reference\_to\_pandemic\_related\_governmental\_responses\_or\_measures</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: Is there specific reference to pandemic-related governmental responses or measures in the clause that qualifies pandemics or other public health events for Material Adverse Effect (MAE)?<br>Option A: No<br>Option B: Yes</td></tr>
|
63 |
+
<tr><td>maud\_type\_of\_consideration</td><td>multiple_choice</td><td>Instruction: Read the segment of a merger agreement and answer the multiple-choice question by choosing the option that best characterizes the agreement.<br>Question: What type of consideration is specified in this agreement?<br>Option A: All Cash<br>Option B: All Stock<br>Option C: Mixed Cash/Stock<br>Option D: Mixed Cash/Stock: Election</td></tr>
|
64 |
+
<tr><td>personal\_jurisdiction</td><td>multiple_choice</td><td>There is personal jurisdiction over a defendant in the state where the defendant is domiciled, or when (1) the defendant has sufficient contacts with the state, such that they have availed itself of the privileges of the state and (2) the claim arises out of the nexus of the defendant's contacts with the state.</td></tr>
|
65 |
+
<tr><td>sara\_entailment</td><td>multiple_choice</td><td>Determine whether the following statements are entailed under the statute.</td></tr>
|
66 |
+
<tr><td>sara\_numeric</td><td>regression</td><td>Answer the following questions.</td></tr>
|
67 |
+
<tr><td>supply\_chain\_disclosure\_best\_practice\_accountability</td><td>multiple_choice</td><td>Evaluates supply chain disclosure practices</td></tr>
|
68 |
+
<tr><td>supply\_chain\_disclosure\_best\_practice\_certification</td><td>multiple_choice</td><td>Evaluates supply chain disclosure practices</td></tr>
|
69 |
+
<tr><td>supply\_chain\_disclosure\_best\_practice\_training</td><td>multiple_choice</td><td>Evaluates supply chain disclosure practices</td></tr>
|
70 |
+
<tr><td>telemarketing\_sales\_rule</td><td>multiple_choice</td><td>The Telemarketing Sales Rule is provided by 16 C.F.R. § 310.3(a)(1) and 16 C.F.R. § 310.3(a)(2).</td></tr>
|
71 |
+
</tbody>
|
72 |
+
</table>
|
73 |
+
</div>
|
74 |
+
|
75 |
+
## Data Format
|
76 |
+
|
77 |
+
Each dataset retains its original columns from LegalBench and adds an `input` column containing a pre-formatted prompt based on the task's instructions and template from the LegalBench registry. This `input` column is designed for direct use with language models. The column structure varies by task; common examples include:
|
78 |
+
|
79 |
+
- **Basic Legal**: `answer`, `index`, `text`, `input`
|
80 |
+
- **Citation**: `answer`, `citation`, `index`, `text`, `input`
|
81 |
+
- **Diversity Analysis**: `aic_is_met`, `answer`, `index`, `parties_are_diverse`, `text`, `input`
|
82 |
+
- **Jurisdiction**: `answer`, `index`, `slice`, `text`, `input`
|
83 |
+
- **SARA Analysis**: `answer`, `case id`, `description`, `index`, `question`, `statute`, `text`, `input`
|
84 |
+
- **Supply Chain Disclosure**: `answer`, `index`, `text`, `input`
|
85 |
+
- **MAUD Contract Analysis**: `answer`, `index`, `text`, `input`
|
86 |
+
|
87 |
+
## Usage
|
88 |
+
|
89 |
+
Load and use a task dataset as follows:
|
90 |
+
|
91 |
+
```python
|
92 |
+
from datasets import load_dataset
|
93 |
+
|
94 |
+
# Load a specific task
|
95 |
+
dataset = load_dataset("DatologyAI/legalbench", "canada_tax_court_outcomes")
|
96 |
+
|
97 |
+
# Access the formatted input and answer
|
98 |
+
example = dataset["test"][0]
|
99 |
+
print("Input:", example["input"])
|
100 |
+
print("Answer:", example["answer"])
|
101 |
+
```
|
102 |
+
|
103 |
+
## Model Evaluation Example
|
104 |
+
|
105 |
+
Evaluate a language model on a task:
|
106 |
+
|
107 |
+
```python
|
108 |
+
from datasets import load_dataset
|
109 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
110 |
+
|
111 |
+
# Load model and tokenizer
|
112 |
+
model_name = "meta-llama/Llama-2-7b-chat-hf"
|
113 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
114 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
115 |
+
|
116 |
+
# Load a task
|
117 |
+
dataset = load_dataset("DatologyAI/legalbench", "personal_jurisdiction")
|
118 |
+
example = dataset["test"][0]
|
119 |
+
|
120 |
+
# Generate response
|
121 |
+
inputs = tokenizer(example["input"], return_tensors="pt")
|
122 |
+
outputs = model.generate(inputs["input_ids"], max_new_tokens=10, temperature=0.0)
|
123 |
+
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
|
124 |
+
|
125 |
+
print(f"Gold answer: {example['answer']}")
|
126 |
+
print(f"Model response: {response}")
|
127 |
+
```
|
128 |
+
|