-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate_songer_tasks.py
More file actions
executable file
·2970 lines (2858 loc) · 180 KB
/
Copy pathgenerate_songer_tasks.py
File metadata and controls
executable file
·2970 lines (2858 loc) · 180 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import os
import json
from tqdm import tqdm
from utils import get_cases_with_maj_opinion, save_opinions, subsample_and_save_decisions
states_file = 'songer_codes/songer_states.txt'
header = "What follows is an opinion from a United States Court of Appeals."
states_instructions = 'Answer with the name of the state, or one of the following territories: ' \
'District of Columbia, Puerto Rico, Virgin Islands, Panama Canal Zone, or "not applicable" or "not determined".'
state_fill = ''
tasks_general = {
'method': {
'name': 'songer_method',
'instruction': f'{header} Your task is to determine the nature of the proceeding in the court of appeals for the case, that is, ' \
'the legal history of the case, indicating whether there had been prior appellate court proceeding on the same ' \
'case prior to the decision currently coded. ' \
'Assume that the case had been decided by the panel for the first time if there was no indication to the ' \
'contrary in the opinion. ' \
'The opinion usually, but not always, explicitly indicates when a decision was made "en banc" (though the spelling of ' \
'"en banc" varies). However, if more than 3 judges were listed as participating in the decision, code the decision ' \
'as enbanc even if there was no explicit description of the proceeding as en banc.',
'question': 'What is the nature of the proceeding in the court of appeals for this case?',
'answer_choices': {
1: 'decided by panel for first time (no indication of re-hearing or remand)',
2: 'decided by panel after re-hearing (second time this case has been heard by this same panel)',
3: 'decided by panel after remand from Supreme Court',
4: 'decided by court en banc, after single panel decision',
5: 'decided by court en banc, after multiple panel decisions',
6: 'decided by court en banc, no prior panel decisions',
7: 'decided by panel after remand to lower court',
8: 'other',
9: 'not ascertained',
}
},
'circuit': {
'name': 'songer_circuit',
'instruction': f'{header} Your task is to identify the circuit of the court that decided the case.',
'question': 'What is the circuit of the court that decided the case?',
'answer_choices': {
1: 'First Circuit', 2: 'Second Circuit', 3: 'Third Circuit',
4: 'Fourth Circuit', 5: 'Fifth Circuit', 6: 'Sixth Circuit',
7: 'Seventh Circuit', 8: 'Eighth Circuit', 9: 'Ninth Circuit',
10: 'Tenth Circuit', 11: 'Eleventh Circuit', 0: 'District of Columbia Circuit',
}
},
'state': {
'name': 'songer_state',
'instruction': f'{header} Your task is to identify the state or territory in which the case was first heard. ' \
'If the case began in the federal district court, consider the state of that district court. ' \
'If it is a habeas corpus case, consider the state of the state court that first heard the case. ' \
f'If the case originated in a federal administrative agency, answer "not applicable". {states_instructions}',
'question': 'In what state or territory was the case first heard?',
'answer_choices': states_file,
},
'district': {
'name': 'songer_district',
'instruction': f'{header} Your task is to identify which district in the state {state_fill} the case came from. ' \
'If the case did not come from a federal district court, answer "not applicable".',
'question': 'From which district in the state was this case appealed?',
'answer_choices': {
0: 'Not applicable',
1: 'Eastern',
2: 'Western',
3: 'Central',
4: 'Middle',
5: 'Southern',
6: 'Northern',
7: 'Whole state is one judicial district',
8: 'Not ascertained',
}
},
'origin': {
'name': 'songer_origin',
'instruction': f'{header} Your task is to identify the type of court which made the original ' \
'decision. Code cases removed from a state court as originating in federal district court. ' \
'For "State court", include habeas corpus petitions after conviction in state court and petitions ' \
'from courts of territories other than the U.S. District Courts. ' \
'For "Special DC court", include courts other than the US District Court for DC. ' \
'For "Other", include courts such as the Tax Court and a court martial.',
'question': 'What type of court made the original decision?',
'answer_choices': {
1: 'Federal district court (single judge)',
2: '3 judge district court',
3: 'State court',
4: 'Bankruptcy court, referee in bankruptcy, special master',
5: 'Federal magistrate',
6: 'Federal administrative agency',
7: 'Special DC court',
8: 'Other ',
9: 'Not ascertained',
}
},
'source': {
'name': 'songer_source',
'instruction': f'{header} Your task is to identify the forum that heard this case immediately before ' \
'the case came to the court of appeals.',
'question': 'What forum heard this case immediately before the case came to the court of appeals?',
'answer_choices': {
1: 'Federal district court (single judge)',
2: '3 judge district court',
3: 'State court',
4: 'Bankruptcy court, referee in bankruptcy, special master',
5: 'Federal magistrate',
6: 'Federal administrative agency',
7: 'Court of Customs & Patent Appeals',
8: 'Court of Claims',
9: 'Court of Military Appeals',
10: 'Tax Court or Tax Board',
11: 'Administrative law judge',
12: 'U.S. Supreme Court (remand)',
13: 'Special DC court (not the US District Court for DC)',
14: 'Earlier appeals court panel',
15: 'Other',
16: 'Not ascertained',
}
},
'applfrom': {
'name': 'songer_applfrom',
'instruction': f'{header} Your task is to identify the type of district court decision or ' \
'judgment appealed from (i.e., the nature of the decision below in the district court).',
'question': 'What is the type of district court decision or ' \
'judgment appealed from (i.e., the nature of the decision below in the district court)?',
'answer_choices': {
1: 'Trial (either jury or bench trial)',
2: 'Injunction or denial of injunction or stay of injunction',
3: 'Summary judgment or denial of summary judgment',
4: 'Guilty plea or denial of motion to withdraw plea',
5: 'Dismissal (include dismissal of petition for habeas corpus)',
6: 'Appeals of post judgment orders (e.g., attorneys\' fees, costs, damages, JNOV - judgment nothwithstanding the verdict)',
7: 'Appeal of post settlement orders',
8: 'Not a final judgment: interlocutory appeal',
9: 'Not a final judgment: mandamus',
10: 'Other (e.g., pre-trial orders, rulings on motions, directed verdicts) or could not determine nature of final judgment',
11: 'Does not fit any of the above categories, but opinion mentions a "trial judge"',
12: 'Not applicable (e.g., decision below was by a federal administrative agency, tax court)',
},
},
'adminrev': {
'name': 'songer_adminrev',
'instruction': f'{header} Your task is to identify the federal agency (if any) whose decision ' \
'was reviewed by the court of appeals. If there was no prior agency ' \
'action, choose "not applicable".',
'question': 'What federal agency\'s decision was reviewed by the court of appeals?',
'answer_choices': {
1: 'Benefits Review Board',
2: 'Civil Aeronautics Board',
3: 'Civil Service Commission',
4: 'Federal Communications Commission',
5: 'Federal Energy Regulatory Commission',
6: 'Federal Power Commission',
7: 'Federal Maritime Commission',
8: 'Federal Trade Commission',
9: 'Interstate Commerce Commission',
10: 'National Labor Relations Board',
11: 'Atomic Energy Commission',
12: 'Nuclear Regulatory Commission',
13: 'Securities & Exchange Commission',
14: 'Other federal agency',
15: 'Not ascertained or not applicable',
}
},
'opinstat': {
'name': 'songer_opinstat',
'instruction': f'{header} Your task is to identify whether the opinion writter is identified in the ' \
'opinion or whether the opinion was per curiam.',
'question': 'Is the opinion writer identified in the opinion, or was the opinion per curiam?',
'answer_choices': {
1: 'Signed, with reasons',
2: 'Per curiam, with reasons',
9: 'Not ascertained',
}
},
'classact': {
'name': 'songer_classact',
'instruction': f'{header} Your task is to determine whether the case is described in the opinion as a ' \
'class action suit. If so, the opinion should specifically indicate that the action was filed ' \
'as a representative of a class or of "all others similarly situated".',
'question': 'Is the case described in the opinion as a class action suit?',
'answer_choices': {
0: 'No',
1: 'Yes',
}
},
'crossapp': {
'name': 'songer_crossapp',
'instruction': f'{header} Your task is to determine whether there were cross appeals ' \
'from the decision below to the court of appeals that were consolidated in the present case.',
'question': 'Were there cross appeals from the decision below to the court of appeals that ' \
'were consolidated in the present case?',
'answer_choices': {
0: 'No',
1: 'Yes',
2: 'Not ascertained',
}
},
# not including sanction since all except two are classified as 'not ascertained'
'initiate': {
'name': 'songer_initiate',
'instruction': f'{header} Your task is to identify what party initiated the appeal. ' \
'For cases with cross appeals or multiple docket numbers, if the opinion does not ' \
'explicitly indicate which appeal was filed first, assumes that the first litigant listed as the ' \
'"appellant" or "petitioner" was the first to file the appeal. ' \
'In federal habeas corpus petitions, consider the prisoner to be the plaintiff.',
'question': 'What party initiated the appeal?',
'answer_choices': {
1: 'Original plaintiff',
2: 'Original defendant',
3: 'Federal agency representing plaintiff',
4: 'Federal agency representing defendant',
5: 'Intervenor',
8: 'Not applicable',
9: 'Not ascertained',
},
}
}
header_participants = 'Intervenors who participated as parties at the courts of appeals should be ' \
'counted as either appellants or respondents when it can be determined whose position they ' \
'supported. For example, if there were two plaintiffs who lost in ' \
'district court, appealed, and were joined by four intervenors who ' \
'also asked the court of appeals to reverse the district court, the ' \
'number of appellants should be coded as six.'
head_appellants = 'In some cases there is some confusion over who should be ' \
'listed as the appellant and who as the respondent. This confusion ' \
'is primarily the result of the presence of multiple docket numbers ' \
'consolidated into a single appeal that is disposed of by a single ' \
'opinion. Most frequently, this occurs when there are cross appeals ' \
'and/or when one litigant sued (or was sued by) multiple litigants ' \
'that were originally filed in district court as separate actions. ' \
'The coding rule followed in such cases should be to go strictly by the ' \
'designation provided in the title of the case. The first person ' \
'listed in the title as the appellant should be coded as the appellant ' \
'even if they subsequently appeared in a second docket number as the ' \
'respondent and regardless of who was characterized as the appellant ' \
'in the opinion.\n' \
'To clarify the coding conventions, consider the following ' \
'hypothetical case in which the US Justice Department sues a labor ' \
'union to strike down a racially discriminatory seniority system and ' \
'the corporation (siding with the position of its union) ' \
'simultaneously sues the government to get an injunction to block ' \
'enforcement of the relevant civil rights law. From a district ' \
'court decision that consolidated the two suits and declared the ' \
'seniority system illegal but refused to impose financial penalties ' \
'on the union, the corporation appeals and the government and union ' \
'file cross appeals from the decision in the suit brought by the ' \
'government. Assume the case was listed in the Federal Reporter as ' \
'follows:\n' \
'United States of America,\n' \
'Plaintiff, Appellant\n' \
'v\n' \
'International Brotherhood of Widget Workers,AFL-CIO\n' \
'Defendant, Appellee.\n' \
'International Brotherhood of Widget Workers,AFL-CIO\n' \
'Defendants, Cross-appellants\n' \
'v\n' \
'United States of America.\n' \
'Widgets, Inc. & Susan Kuersten Sheehan, President & Chairman\n' \
'of the Board\n' \
'Plaintiff, Appellants,\n' \
'v\n' \
'United States of America,\n' \
'Defendant, Appellee.\n' \
'This case should be coded as follows:' \
'Appellant = United States, ' \
'Respondents = International Brotherhood of Widget Workers Widgets, Inc., ' \
'Total number of appellants = 1, ' \
'Number of appellants that fall into the category "the federal government, its agencies, and officials" = 1, ' \
'Total number of respondents = 3, ' \
'Number of respondents that fall into the category "private business and its executives" = 2, ' \
'Number of respondents that fall into the category "groups and associations" = 1.' \
header_specific_app = 'Note that if an individual is listed by name, but their ' \
'appearance in the case is as a government official, then they should be ' \
'counted as a government rather than as a private person. For ' \
'example, in the case "Billy Jones & Alfredo Ruiz v Joe Smith" where ' \
'Smith is a state prisoner who brought a civil rights suit against ' \
'two of the wardens in the prison (Jones & Ruiz), the following ' \
'values should be coded: number of appellants that fall into the ' \
'category "natural persons" =0 and number that fall into the category ' \
'"state governments, their agencies, and officials" =2. A similar logic ' \
'should be applied to businesses and associations. Officers of a company ' \
'or association whose role in the case is as a representative of ' \
'their company or association should be coded as being a business or ' \
'association rather than as a natural person. However, employees of ' \
'a business or a government who are suing their employer should be coded ' \
'as natural persons. Likewise, employees who are charged with ' \
'criminal conduct for action that was contrary to the company ' \
'policies should be considered natural persons.\n' \
'If the title of a case listed a corporation by name and then ' \
'listed the names of two individuals that the opinion indicated were ' \
'top officers of the same corporation as the appellants, then the ' \
'number of appellants should be coded as three and all three were coded as ' \
'a business (with the identical detailed code). Similar logic should be ' \
'applied when government officials or officers of an association ' \
'were listed by name.'
header_nature_participants = 'When coding the detailed nature of participants, ' \
'use your personal knowledge about the ' \
'participants, if you are completely confident of the accuracy of ' \
'your knowledge, even if the specific information is not in ' \
'the opinion. For example, if "IBM" is listed as the appellant it ' \
'could be classified as "clearly national or international in scope" ' \
'even if the opinion did not indicate the scope of the business. ' \
# for the first appellant and the second appellant! APPEL1 and APPEL2, RESPOND1, RESPOND2
# this is constructed using GENAPP1, GENAPP2, GENRESP1, GENRESP2
party_details = {
1: { # general category 1
2: {
'instruction': 'Your task is to classify the scope of this business into one of the ' \
'following categories: "local" (individual or family owned business, scope ' \
'limited to single community; generally proprietors, who are not incorporated); ' \
'"neither local nor national" (e.g., an ' \
'electrical power company whose operations cover one-third of the state); ' \
'"national or multi-national" (assume that insurance companies and ' \
'railroads are national in scope); and ' \
'"not ascertained".',
'question': 'What is the scope of this business?',
'answer_choices': {
1: 'local',
2: 'neither local nor national',
3: 'national or multi-national',
4: 'not ascertained',
},
},
3: {
'instruction': 'Your task is to determine what category of business best describes ' \
'the area of activity of this litigant which is involved in this case.',
'question': 'What category of business best describes the area of activity of this ' \
'litigant which is involved in this case?',
'answer_choices': {
1: 'agriculture',
2: 'mining',
3: 'construction',
4: 'manufacturing',
5: 'transportation',
6: 'trade',
7: 'financial institution',
8: 'utilities',
9: 'other',
0: 'unclear',
}
},
4: {
'instruction': 'Your task is to determine what subcategory of business best describes this litigant.',
'question': 'What subcategory of business best describes this litigant?',
'choosing_rule': lambda x: str(x)[2], # third digit
'possible_choices': {
1: {
1: 'single family farm',
2: 'commercial farm, agri-business',
3: 'farm - other ',
0: 'unclear',
},
2: {
1: 'oil and gas',
2: 'coal',
3: 'metals',
4: 'other ',
0: 'unclear',
},
3: {
1: 'residential',
2: 'commercial or industrial',
3: 'other',
0: 'unclear'
},
4: {
1: 'auto',
2: 'chemical',
3: 'drug',
4: 'food processing',
5: 'oil refining',
6: 'textile',
7: 'electronic',
8: 'alcohol or tobacco',
9: 'other',
0: 'unclear',
},
5: {
1: 'railroad',
2: 'boat, shipping',
3: 'shipping freight, UPS, flying tigers',
4: 'airline',
5: 'truck, armored cars',
6: 'other',
0: 'unclear',
},
6: {
1: 'auto, auto parts, auto repairs',
2: 'chemical',
3: 'drug',
4: 'food',
5: 'oil, natural gas, gasoline',
6: 'textile, clothing',
7: 'electronic',
8: 'alcohol or tobacco',
9: 'general merchandise',
10: 'other ',
0: 'unclear',
},
7: {
1: 'bank',
2: 'insurance',
3: 'savings and loan',
4: 'credit union',
6: 'other pension fund',
7: 'other financial institution or investment company',
0: 'unclear',
},
8: {
1: 'nuclear power plants',
2: 'other producers of power',
3: 'telephone',
4: 'other utilities',
0: 'unclear',
},
9: {
1: 'medical clinics, health organizations, nursing homes, ' \
'medical doctors, medical labs, or other private health ' \
'care facilities',
2: 'private attorney or law firm',
3: 'media - including magazines, newspapers, radio & TV ' \
'stations and networks, cable TV, news organizations',
4: 'school - for profit private educational enterprise ' \
'(including business and trade schools)',
5: 'housing, car, or durable goods rental or lease',
6: 'entertainment: amusement parks, race tracks, for profit ' \
'camps, record companies, movie theaters and producers, ' \
'ski resorts, hotels, restaurants, etc.',
7: 'information processing',
8: 'consulting',
9: 'security and/or maintenance service',
10: 'other service (including accounting)',
11: 'other (including a business pension fund)',
0: 'unclear',
},
0: {
1: 'auto industry',
2: 'chemical industry',
3: 'drug industry',
4: 'food industry',
5: 'oil & gas industry',
6: 'clothing & textile industry',
7: 'electronic industry',
8: 'alcohol and tobacco industry',
9: 'other',
0: 'unclear'
},
}
}
},
2: {
2: {
'instruction': 'Your task is to determine what category of private associations best describes this litigant.',
'question': 'What category of private associations best describes this litigant?',
'answer_choices': {
1: 'business, trade, professional, or union (BTPU)',
2: 'other',
},
},
# describe specific subcategories of organizations
3: {
'instruction': 'Your task is to determine what subcategory of private association best describes this litigant.',
'question': 'What subcategory of private association best describes this litigant?',
'choosing_rule': lambda x: str(x)[1], # second digit
'possible_choices': {
1: {
1: 'Business or trade association',
2: 'utilities co-ops',
3: 'Professional association - other than law or medicine',
4: 'Legal professional association',
5: 'Medical professional association',
6: 'AFL-CIO union (private)',
7: 'Other private union',
8: 'Private Union - unable to determine whether in AFL-CIO',
9: 'Public employee union- in AFL-CIO ' \
'(include groups called professional organizations if ' \
'their role includes bargaining over wages and work conditions)',
10: 'Public Employee Union - not in AFL-CIO',
11: 'Public Employee Union - unable to determine if in AFL-CIO',
12: 'Union pension fund; other union funds (e.g., vacation funds)',
13: 'Other',
0: 'Unclear',
},
2: {
1: 'Civic, social, fraternal organization',
2: 'Political organizations - Other than political parties ' \
'Examples: Civil rights focus; Public Interest - broad, ' \
'civil liberties focus (ACLU) or broad, multi-issue focus ' \
'(Common Cause, Heritage Foundation, ADA) or single issue ' \
'- Environmental ENV, Abortion, etc. (prolife, ' \
'pro-abortion), elderly, consumer interests: Consumer ' \
'Federation of America, Consumer\'s Union, National ' \
'Railroad Passenger Association; PAC',
3: 'Political party',
4: 'Educational organization - Private, non-profit school',
5: 'Educational organization - Association, not individual school - PTA or PTO',
6: 'Religious or non-profit hospital or medical care facility (e.g., nursing home)',
7: 'Other religious organization (includes religious foundations)',
8: 'Charitable or philanthropic organization (including ' \
'foundations, funds, private museums, private libraries)',
9: 'Other',
0: 'Unclear'
}
}
}
},
3: {
2: {
'instruction': 'Your task is to determine which category of federal government agencies and activities best describes this litigant.',
'question': 'Which category of federal government agencies and activities best describes this litigant?',
'answer_choices': {
1: 'cabinet level department',
2: 'courts or legislative',
3: 'agency whose first word is "federal"',
4: 'other agency, beginning with "A" thru "E"',
5: 'other agency, beginning with "F" thru "N"',
6: 'other agency, beginning with "O" thru "R"',
7: 'other agency, beginning with "S" thru "Z"',
8: 'Distric of Columbia',
9: 'other, not listed, not able to classify',
},
},
3: {
'instruction': 'Your task is to determine which specific federal government agency best describes this litigant.',
'question': 'Which specific federal government agency best describes this litigant?',
'choosing_rule': lambda x: str(x)[1], # second digit
'possible_choices': {
1: {
1: 'Department of Agriculture',
2: 'Department of Commerce',
3: 'Department of Defense (includes War Department and Navy Department)',
4: 'Department of Education',
5: 'Department of Energy',
6: 'Department of Health, Education and Welfare',
7: 'Department of Health & Human Services',
8: 'Department of Housing and Urban Development',
9: 'Department of Interior',
10: 'Department of Justice (does not include FBI or parole boards; does include US Attorneys)',
11: 'Department of Labor (except OSHA)',
12: 'Post Office Department',
13: 'Department of State',
14: 'Department of Transportation, National Transportation Safety Board',
15: 'Department of the Treasury (except IRS)',
16: 'Department of Veterans Affairs',
},
2: {
1: 'one or both houses of Congress',
2: 'congressional committee',
3: 'officer of Congress or other Congress related actor',
4: 'Federal District Court (or judge)',
5: 'Federal Circuit Court of Appeals (or judge)',
6: 'Court of Claims (or judge)',
7: 'Tax Court (or judge)',
8: 'Bankruptcy Court (or judge)',
9: 'other court or judge',
},
3: {
1: 'Federal Aviation Administration',
2: 'Federal Bureau of Investigation (FBI)',
3: 'Federal Coal Mine Safety Board',
4: 'Federal Communications Commission',
5: 'Federal Deposit Insurance Corporation and FSLIC',
6: 'Federal Election Commission',
7: 'Federal Energy Agency (Federal Power Commission)',
8: 'Federal Energy Regulatory Commission',
9: 'Federal Home Loan Bank Board',
10: 'Federal Housing Authority (FHA)',
11: 'Federal Labor Relations Authority',
12: 'Federal Maritime Board',
13: 'Federal Maritime Commission',
14: 'Federal Mine Safety & Health Administration',
15: 'Federal Mine Safety & Health Review Commission',
16: 'Federal Reserve System',
17: 'Federal Trade Commission',
},
4: {
1: 'Benefits Review Board',
2: 'Civil Aeronautics Board',
3: 'Civil Service Commission (U.S.)',
4: 'Commodity Futures Trading Commission',
5: 'Consumer Products Safety Commission',
6: 'Copyright Royalty Tribunal',
7: 'Drug Enforcement Agency',
8: 'Environmental Protection Agency',
9: 'Equal Employment Opportunity Commission',
},
5: {
1: 'Food & Drug Administration',
2: 'General Services Administration',
3: 'Government Accounting Office (GAO)',
4: 'Health Care Financing Administration',
5: 'Immigration & Naturalization Service (includes border patrol)',
6: 'Internal Revenue Service (IRS)',
7: 'Interstate Commerce Commission',
8: 'Merit Systems Protection Board',
9: 'National Credit Union Association',
10: 'National Labor Relations Board',
11: 'Nuclear Regulatory Commission',
},
6: {
1: 'Occupational Safety & Health Administration',
2: 'Occupational Safety & Health Review Commission',
3: 'Office of the Federal Inspector',
4: 'Office of Management & Budget',
5: 'Office of Personnel Management',
6: 'Office of Workers Compensation Program',
7: 'Parole board or parole commisssion, or prison official, or US Bureau of Prisons',
8: 'Patent Office',
9: 'Postal Rate Commission (U.S.)',
10: 'Postal Service (U.S.)',
11: 'RR Adjustment Board',
12: 'RR Retirement Board',
},
7: {
1: 'Securities & Exchange Commission',
2: 'Small Business Administration',
3: 'Veterans Administration',
},
8: {
1: 'DC in its corporate capacity',
2: 'legislative body for DC local government',
3: 'mayor, agency head or top administrator',
4: 'bureaucracy providing service',
5: 'bureaucracy in charge of regulation',
6: 'bureaucracy in charge of general administration',
7: 'judicial',
8: 'other',
},
9: {
1: 'United States - in corporate capacity (i.e., as representative of "the people") - in criminal cases',
2: 'United States - in corporate capacity - civil cases',
3: 'special wartime agency',
4: 'Other unlisted federal agency (includes the President of the US)',
5: 'Unclear or nature not ascertainable',
}
}
},
},
4: {
2: {
'instruction': 'Your task is to determine which category of substate government best describes this litigant.',
'question': 'Which category of substate government best describes this litigant?',
'answer_choices': {
1: 'legislative',
2: 'executive/administrative',
3: 'bureaucracy providing services',
4: 'bureaucracy in charge of regulation',
5: 'bureaucracy in charge of general administration',
6: 'judicial',
7: 'other',
},
},
3: {
'instruction': 'Your task is to determine which specific substate government agency best describes this litigant.',
'question': 'Which specific substate government agency best describes this litigant?',
'choosing_rule': lambda x: str(x)[1], # second digit
'possible_choices': {
1: {
1: 'City/county council',
2: 'School Board, board of trustees for college or junior college',
3: 'Other legislative body',
0: 'not ascertained',
},
2: {
1: 'CEO or officials in charge of agency',
2: 'Mayor/county executive',
3: 'Primary or secondary school system CEO',
4: 'Other CEO or administrative official (except prison)',
0: 'not ascertained',
},
3: {
1: 'Police, Sheriff',
2: 'Fire',
3: 'Taxation',
4: 'Human Services/Welfare/Health Care',
5: 'Streets and Highways',
6: 'Transportation',
7: 'Election Processes',
8: 'Education - Not School Board',
9: 'Other Service Activity',
0: 'not ascertained',
},
4: {
1: 'Environment',
2: 'Market Practices',
3: 'Transportation',
4: 'Professions (licensing)',
5: 'Labor-Management',
6: 'Communications',
7: 'Zoning/Land Use',
8: 'Building and Housing',
9: 'Other Regulating Activity',
0: 'not ascertained',
},
5: {
1: 'Personnel',
2: 'Other General Administration',
0: 'not ascertained',
},
6: {
1: 'Judge or Court (local trial court judge or justice of peace)',
2: 'Prosecutor/district attorney',
3: 'Jail/Prison/Probation Official and Organization (includes prison hospitals; includes juvenile correction officials)',
4: 'Other Judical Official',
0: 'not ascertained',
},
7: {
1: 'City of, county of, etc. - in corporate capacity - criminal case',
2: 'city of, county of, etc. - in corporate capacity - civil case',
3: 'Other sub-state activity',
0: 'not ascertained',
}
}
},
},
5: {
2: {
'instruction': 'Your task is to determine which category of state government best describes this litigant.',
'question': 'Which category of state government best describes this litigant?',
'answer_choices': {
1: 'legislative',
2: 'executive/administrative',
3: 'bureaucracy providing services',
4: 'bureaucracy in charge of regulation',
5: 'bureaucracy in charge of general administration',
6: 'judicial',
7: 'other',
},
},
3: {
'instruction': 'Your task is to determine which specific state government agency best describes this litigant.',
'question': 'Which specific state government agency best describes this litigant?',
'choosing_rule': lambda x: str(x)[1], # second digit
'possible_choices': {
1: {
1: 'Legislature or separate house as an organization',
2: 'Legislative Committee or Commission',
3: 'Other Legislative Unit',
0: 'not ascertained',
},
2: {
1: 'Governor',
2: 'Attorney General',
3: 'Secretary of State',
4: 'Other Administrative Officer NOT detailed below',
0: 'not ascertained',
},
3: {
1: 'Police',
2: 'Fire',
3: 'Taxation',
4: 'Human Services/Welfare/Health Care',
5: 'Streets and Highways',
6: 'Transportation',
7: 'Election processes',
8: 'Education',
9: 'Other Service Activity',
0: 'not ascertained',
},
4: {
1: 'Environment',
2: 'Market Practices',
3: 'Transportation',
4: 'Professions (licensing)',
5: 'Labor-Management',
6: 'Communications',
7: 'Zoning/Land Use',
8: 'Building and Housing',
9: 'Other Regulating Activity',
0: 'not ascertained',
},
5: {
1: 'Personnel',
2: 'Other General Administration',
0: 'not ascertained',
},
6: {
1: 'Judge (non-local judge; appellate judge)',
2: 'Prosecutor/district attorney (non-local, e.g., special prosecutor)',
3: 'Jail/Prison/Probation Official (includes juvenile officials)',
4: 'Other judicial official',
0: 'not ascertained',
},
7: {
1: 'state of ___ - state in its corporate capacity in criminal cases',
2: 'state 0f ___ - state in its corporate capacity in civil cases',
3: 'other state level activity',
0: 'not ascertained',
},
}
},
},
7: {
2: {
'instruction': 'Your task is to determine the gender of this litigant. ' \
'Use names to classify the party\'s sex only if there is little ambiguity ' \
'(e.g., the sex of "Chris" should be coded as "not ascertained").',
'question': 'What is the gender of this litigant?' \
'Use names to classify the party\'s sex only if there is little ambiguity.',
'answer_choices': {
0: 'not ascertained',
1: 'male - indication in opinion (e.g., use of masculine pronoun)',
2: 'male - assumed because of name',
3: 'female - indication in opinion of gender',
4: 'female - assumed because of name',
},
},
3: {
'instruction': 'Your task is to determine the race or ethnic identity of this litigant as identified in the opinion. ' \
'Names may be used to classify a person as hispanic if there is little ambiguity. ' \
'All aliens are coded as "not ascertained".',
'question': 'What is the race or ethnic identity of this litigant as identified in the opinion?',
'answer_choices': {
0: 'not ascertained',
1: 'caucasian - specific indication in opinion',
2: 'black - specific indication in opinion',
3: 'native american - specific indication in opinion',
4: 'native american - assumed from name',
5: 'asian - specific indication in opinion',
6: 'asian - assumed from name',
7: 'hispanic - specific indication in opinion',
8: 'hispanic - assumed from name',
9: 'other',
},
},
4: {
'instruction': 'Your task is to determine the citizenship of this litigant as indicated in the opinion.',
'question': 'What is the citizenship of this litigant as indicated in the opinion?',
'answer_choices': {
0: 'not ascertained',
1: 'US citizen',
2: 'alien',
},
},
5: {
'instruction': 'Your task is to determine which of these categories best describes the income of the litigant. ' \
'Consider the following categories: "not ascertained", ' \
'"poor + wards of state" (e.g., patients at state mental hospital; not prisoner unless specific indication that poor), ' \
'"presumed poor" (e.g., migrant farm worker), ' \
'"presumed wealthy" (e.g., high status job - like medical doctors, executives of corporations that are national ' \
'in scope, professional athletes in the NBA or NFL; upper 1/5 of income bracket), ' \
'"clear indication of wealth in opinion", ' \
'"other - above poverty line but not clearly wealthy" (e.g., public school teachers, federal government employees)." ' \
'Note that "poor" means below the federal poverty line; e.g., welfare or food stamp recipients. ' \
'There must be some specific indication in the opinion that you can point to before anyone is classified anything other than "not ascertained". ' \
'Prisoners filing "pro se" were classified as poor, but litigants in civil cases who proceed pro se were not presumed to be poor. ' \
'Wealth obtained from the crime at issue in a criminal case was not counted when determining the wealth of the criminal defendant (e.g., drug dealers).',
'question': 'Which of these categories best describes the income of the litigant?',
'answer_choices': {
0: 'not ascertained',
1: 'poor + wards of state',
2: 'presumed poor',
3: 'presumed wealthy',
4: 'clear indication of wealth in opinion',
5: 'other - above poverty line but not clearly wealthy',
},
},
},
8: {
2: {
'instruction': 'Your task is to determine which of the following categories best describes the litigant.',
'question': 'Which of the following categories best describes the litigant?',
'answer_choices': {
1: 'fiduciary, executor, or trustee',
2: 'other',
3: 'nature of the litigant not ascertained',
},
},
3: {
'instruction': 'Your task is to determine which of the following specific subcategories best describes the litigant.',
'question': 'Which of the following specific subcategories best describes the litigant?',
'choosing_rule': lambda x: str(x)[1], # second digit
'possible_choices': {
1: {
1: 'trustee in bankruptcy - institution',
2: 'trustee in bankruptcy - individual',
3: 'executor or administrator of estate - institution',
4: 'executor or administrator of estate - individual',
5: 'trustees of private and charitable trusts - institution',
6: 'trustee of private and charitable trust - individual',
7: 'conservators, guardians and court appointed trustees for minors, mentally incompetent',
8: 'other fiduciary or trustee',
0: 'specific subcategory not ascertained',
},
2: {
1: 'Indian Tribes',
2: 'Foreign Government',
3: 'Multi-state agencies, boards, etc. (e.g., Port Authority of NY)',
4: 'International Organizations',
5: 'Other',
0: 'Not ascertained',
},
}
},
},
}
litigant_general_categories = {
1: 'private business (including criminal enterprises)',
2: 'private organization or association',
3: 'federal government (including DC)',
4: 'sub-state government (e.g., county, local, special district)',
5: 'state government (includes territories & commonwealths)',
6: 'government - level not ascertained',
7: 'natural person (excludes persons named in their official ' \
'capacity or who appear because of a role in a private organization)',
8: 'miscellaneous',
9: 'not ascertained',
}
def build_app_resp_tasks():
all_header = f'{header}\n{header_participants}\n{header_nature_participants}\n'
litigant_text = {
'appel1': 'first listed appellant',
'appel2': 'second listed appellant',
'respond1': 'first listed respondent',
'respond2': 'second listed respondent',
}
for lit_code, lit_txt in litigant_text.items():
for cat_code, cat_txt in litigant_general_categories.items():
if cat_code in [6, 9]:
continue
cat_header = f'The nature of this litigant falls into the category "{cat_txt}"'
for digit, task in party_details[cat_code].items():
task_name = f"songer_{lit_code}_{cat_code}_{digit}"
q_header = f'This question concerns the {lit_txt}. {cat_header}'
task_header = f'{all_header}\nYour task concerns the {lit_txt}. {cat_header}'
if 'answer_choices' in task:
task_ = {
'name': task_name,
'instruction': f'{task_header}. {task["instruction"]}',
'question': f'{q_header}. {task["question"]}',
'answer_choices': task['answer_choices'],
}
yield lit_code, cat_code, digit, None, task_
else:
assert 'possible_choices' in task, 'possible_choices must be provided for task without answer_choices'
for choice_code, answer_choices in task['possible_choices'].items():
digit_header = party_details[cat_code][digit-1]['answer_choices'][choice_code]
task_ = {
'name': f"{task_name}_{choice_code}",
'instruction': f'{task_header}, specifically "{digit_header}". {task["instruction"]}',
'question': f'{q_header}, specifically "{digit_header}". {task["question"]}',
'answer_choices': answer_choices,
}
yield lit_code, cat_code, digit, choice_code, task_
tasks_participants = {
'numappel' : {
'name': 'songer_numappel',
'instruction': f'{header}\n{header_participants}\n{head_appellants}\n' \
'Your specific task is to determine the total number of appellants in the case. ' \
'If the total number cannot be determined (e.g., if the appellant is ' \
'listed as "Smith, et. al." and the opinion does not specify who is ' \
'included in the "et.al."), then answer 99.',
'question': 'What is the total number of appellants in the case? Answer with a number.',
'type': 'int',
},
'appnatpr': {
'name': 'songer_appnatpr',
'instruction': f'{header}\n{header_participants}\n{head_appellants}\n{header_specific_app}\n' \
'Your specific task is to determine the total number of appellants in the case ' \
'that fall into the category "natural persons". '
'If the total number cannot be determined (e.g., if the appellant is ' \
'listed as "Smith, et. al." and the opinion does not specify who is ' \
'included in the "et.al."), then answer 99.',
'question': 'What is the total number of appellants in the case ' \
'that fall into the category "natural persons"? Answer with a number.',
'type': 'int',
},
'appbus': {
'name': 'songer_appbus',
'instruction': f'{header}\n{header_participants}\n{head_appellants}\n{header_specific_app}\n' \
'Your specific task is to determine the total number of appellants in the case ' \
'that fall into the category "private business and its executives". '
'If the total number cannot be determined (e.g., if the appellant is ' \
'listed as "Smith, et. al." and the opinion does not specify who is ' \
'included in the "et.al."), then answer 99.',
'question': 'What is the total number of appellants in the case ' \
'that fall into the category "private business and its executives"? Answer with a number.',
'type': 'int',
},
'appnonp': {
'name': 'songer_appnonp',
'instruction': f'{header}\n{header_participants}\n{head_appellants}\n{header_specific_app}\n' \
'Your specific task is to determine the total number of appellants in the case ' \
'that fall into the category "groups and associations". '