Opinions of John Marshall and Joseph Story

Source Notebook

All the Supreme Court opinions of Chief Justice John Marshall and Justice Joseph Story

Details

This repository was obtained with the assistance of Professor and Law Library Director Amanda Watson (University of Houston Law Center) by performing a LEXIS search using case citations obtained by performing searches on the Harvard Law School case.law dataset. The cases were then downloaded as ZIP archives of Microsoft Word files. Professor Chandler then used Microsoft Word to convert the files to HTML. The HTML files were then imported the files into the Mathematica FrontEnd, and stripped the cases of any intellectual property of LEXIS. Regular Expressions were then used to segment the files into the opinions of the two justices.
The repository is intended to be used for machine learning.

Examples

Basic Examples

In[1]:=
ops = ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\)]
Out[1]=

Scope & Additional Elements

In[2]:=
ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\), "CaseNames"] // Short
Out[2]=
In[3]:=
ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\), "OpinionSentences"] // Short
Out[3]=
In[4]:=
(substantiveSentences = ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\), "SubstantiveOpinionSentences"]) // Map[Short]
Out[4]=
In[5]:=
ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\), "NorthernNeckIndices"] // Map[Short]
Out[5]=

Visualizations (1) 

What is the distribution of sentence lengths by each author:

In[6]:=
Query[DistributionChart[#, ChartStyle -> "SouthwestColors", ChartElementFunction -> "HistogramDensity", ChartLabels -> Automatic] &, Flatten, StringLength][substantiveSentences]
Out[6]=

Analysis (3) 

What is the count of case names in opinions written by Marshall and Story:

In[7]:=
Query[All, Counts/*ReverseSort/*(Take[#, UpTo[20]] &)][
 ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\), "CaseNames"]]
Out[7]=

How many sentences would one need to group together within an opinion to consistently get more than 500 characters:

In[8]:=
AssociationMap[
 chunks |-> Query[All, StringLength/*
      Flatten/*(BinCounts[#, {{0, 500, 1000, 100000}}] &)/*(Normalize[#, Total] &)/*(AssociationThread[{"Less than 500", "500 to 999",
           "1000 or more"}, #] &), (Partition[#, chunks] &)/*
      ResourceFunction[
ResourceObject[<|"Name" -> "ApplyLevel", "ShortName" -> "ApplyLevel", "UUID" -> "94444d3b-d884-4aef-971d-ee99d84b6c1e", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Create an operator that applies a function over data at a specified level", "RepositoryLocation" -> URL[
           "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"],
           "SymbolName" -> "FunctionRepository`$748067e3e59c480b93f5429ea81244af`ApplyLevel", "FunctionLocation" -> CloudObject[
           "https://www.wolframcloud.com/obj/2eeea0ed-57f4-4b26-ba16-c8ce0e3fad3e"]|>, ResourceSystemBase -> Automatic]][StringJoin, {1}]][
    substantiveSentences] // Dataset/*ResourceFunction[
ResourceObject[<|"Name" -> "FormatDataset", "ShortName" -> "FormatDataset", "UUID" -> "76670bca-1587-4e7e-9e89-5b698a30759d", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Format a dataset using a given set of option values", "RepositoryLocation" -> URL[
         "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "FunctionRepository`$66a3086203b4405b88cdb0de8a5c3128`FormatDataset", "FunctionLocation" -> CloudObject[
         "https://www.wolframcloud.com/obj/70389ad6-7dbc-48c8-b898-72c65c00f14e"]|>, ResourceSystemBase -> Automatic]][ItemStyle -> 8, HeaderStyle -> 8, HeaderSize -> {6, 1}], Range[6]]
Out[8]=

Retrieve the case names and the 10 most common non-stopwords of the text of the Northern Neck opinions of Justice Story:

In[9]:=
neckQuery = Query["Story", ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\), "NorthernNeckIndices"]["Neck"]];
AssociationThread[neckQuery[ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\), "CaseNames"]], Map[DeleteStopwords/*TextWords/*Counts/*ReverseSort/*(Take[#, 10] &),
   neckQuery[ResourceData[\!\(\*
TagBox["\"\<Opinions of John Marshall and Joseph Story\>\"",
#& ,
BoxID -> "ResourceTag-Opinions of John Marshall and Joseph Story-Input",
AutoDelete->True]\)]]]]
Out[5]=

Seth J. Chandler, "Opinions of John Marshall and Joseph Story" from the Wolfram Data Repository (2022)  

Data Resource History

Source Metadata

See Also

Data Downloads

Publisher Information