Wolfram Computation Meets Knowledge

State of the Union Addresses

Complete text of State of the Union addresses from 1790 to 2019

Originator: Brad Borevitz

This dataset contains every State of the Union address from 1790 to 2019 in plain text format, with dates for each speech, overall and individual word counts, and information about the political party and age of each president as of the date of the speech.

Examples

Basic Examples

Retrieve the resource:

In[1]:=
ResourceObject["State of the Union Addresses"]
Out[1]=

Retrieve the default content:

In[2]:=
ResourceData["State of the Union Addresses"]
Out[2]=

Visualization

Find the longest speeches:

In[3]:=
ResourceData["State of the Union Addresses"][SortBy[#Words &]][
  All, {"President", "Year", "Words"}] // Reverse
Out[3]=

Show word counts over time:

In[4]:=
DateListPlot[
 ResourceData["State of the Union Addresses"][All, {"Date", "Words"}],
  PlotRange -> All]
Out[4]=

Compare word counts for Democratic and Republican presidents :

In[5]:=
With[{partyDates = 
   GroupBy[ResourceData["State of the Union Addresses"], #Party &][
    All, All, {"Date", "Words"}]},
 DateListPlot[{Normal@partyDates["Democratic"], 
   Normal@partyDates["Republican"]}, Joined -> False, 
  Filling -> Bottom, PlotLegends -> {"Democratic", "Republican"}]]
Out[5]=

Show a distribution of word counts by political party:

In[6]:=
partyCounts = 
 GroupBy[ResourceData["State of the Union Addresses"], #Party &][All, 
  All, "Words"]
Histogram[partyCounts, ChartLayout -> "Stacked", 
 ChartLegends -> Automatic]
Out[6]=
Out[7]=

Plot median speech lengths by political party:

In[8]:=
BarChart[Median /@ 
  GroupBy[ResourceData["State of the Union Addresses"], "Party"][All, 
   All, "Words"], BarOrigin -> Left, ChartLabels -> Automatic]
Out[8]=

Show the frequency of specific words over time :

In[9]:=
Manipulate[
 DateListPlot[
  ResourceData["State of the Union Addresses"][
   All, {#Date, #WordCounts[ToString[word]]} &], Joined -> False, 
  Filling -> Bottom], {word, freedom}]
Out[9]=

Generate a word cloud of a single president's speeches:

In[10]:=
WordCloud[
 StringJoin@
  Normal@ResourceData["State of the Union Addresses"][
     Select[#President == 
        Entity["Person", "FranklinDRoosevelt::xj8jv"] &]][All, 
    "Text"], IgnoreCase -> True]
Out[10]=

Wolfram Research, "State of the Union Addresses" from the Wolfram Data Repository (2019) https://doi.org/10.24097/wolfram.05676.data

Data Resource History

Source Metadata

Publisher Information