{"id":26507731,"url":"https://github.com/jacksonwalters/scotus-v-public","last_synced_at":"2025-03-20T23:33:11.493Z","repository":{"id":146379918,"uuid":"132904211","full_name":"jacksonwalters/scotus-v-public","owner":"jacksonwalters","description":"Capstone project for The Data Incubator ('18). Plots SCOTUS vs. public opinion polarity over time given keywords.","archived":false,"fork":false,"pushed_at":"2024-12-17T11:10:07.000Z","size":65387,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-17T12:20:36.743Z","etag":null,"topics":["correlation-analysis","deep-learning","machine-learning","opinion-polls","opinion-summarization","sentiment-polarity","supreme-court","supreme-court-cases"],"latest_commit_sha":null,"homepage":"https://scotus-v-public.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacksonwalters.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-10T13:28:32.000Z","updated_at":"2024-12-17T11:10:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"58a1d7cf-1645-4828-b2e7-cfb83773130f","html_url":"https://github.com/jacksonwalters/scotus-v-public","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksonwalters%2Fscotus-v-public","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksonwalters%2Fscotus-v-public/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksonwalters%2Fscotus-v-public/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksonwalters%2Fscotus-v-public/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacksonwalters","download_url":"https://codeload.github.com/jacksonwalters/scotus-v-public/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244711713,"owners_count":20497415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["correlation-analysis","deep-learning","machine-learning","opinion-polls","opinion-summarization","sentiment-polarity","supreme-court","supreme-court-cases"],"created_at":"2025-03-20T23:33:10.966Z","updated_at":"2025-03-20T23:33:11.480Z","avatar_url":"https://github.com/jacksonwalters.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#scotus-v-public-opinion\n\nThis is the capstone project I did for a data science fellowship with The Data Incubator\nin Oakland, CA beginning in 2018.\n\nThe idea is to compare supreme court opinions and public opinion on arbitrary issues over time.\n\nPublic opinion questions and responses are pulled from the ANES time series, 1948-2016.\nSupreme Court opinions are publicly available, and text of those opinions were gathered\nusing an API from Free Law Project and the help of Michael Lissner. In the intervening\nyears, it has become easier to obtain this data as a bulk download from CourtListener.\n\nThe SCOTUS opinion text data is labeled as being decided in a liberal or conservative direction, and the magnitude is given by the vote ratio for each case. We normalize to a [-1,+1] scale corresponding to the [CONSERVATIVE,LIBERAL] spectrum, one of many axes.\n\nThe public opinion questions have answers which are over a range of values, e.g. yes/no,\nstrongly agree - strongly disagree, a temperature 0-100, etc. We'd like to map a\n(question, answer) pair to a statement whose sentiment can be analyzed. For example,\nQ: \"Do you support government subsidized health care?\" A: \"Yes.\" should be interpreted\nas a liberal sentiment, +1.\n\nRather than trying to combine the questions and answers into statement sentences and\nmap directly to a [-1,+1] scale, it is cleaner to perform a binary classification on\nthe questions themselves to determine liberal/conservative direction {-1,+1}, and then\nuse the responses to gauge the magnitude. The subtlety is you must pick an orientation,\ni.e. the classification is telling you that an *affirmative/yes/agree/warm feeling*\nresponse to the question at hand indicates a liberal sentiment, and should be\nclassified as +1. In mathematics, orientation is an element of Z/2Z.\n\nTo perform this classification, I use a neural network with a 1d CNN layer trained\nusing the Tensorflow/Keras framework. This performs well on text data as it is\nable to pick out short distance correlations between words. I hand classify a\nsubset of the 1,000 or so public opinion questions and train the network using\nthis dataset. Ideally, all questions would be labeled.\n\nThe interface is a Flask webapp. The user inputs a set of keywords, and a TF-IDF search of\nSCOTUS cases by opinion text and public opinion questions by question text yields a set of relevant cases and questions. The liberal/conservative direction of SCOTUS opinion and public opinion are computed resulting in a plot of ideological polarity for both over time. One can then perform regressions and try to determine when opinion might cross a threshold, etc.\n\nOf course, with more data the resulting plots will be more informative, and likely become\nrather jagged, like a stock market tracker. These data could be filled in with relevant\nstate and local case data, and supplemented with more public opinion questions.\n\n- SCOTUS Case \u0026 Justice Data: http://scdb.wustl.edu/\n- SCOTUS Opinions, Free Law Project: https://www.courtlistener.com/api/bulk-info/\n- Public Opinion Data, ANES: https://electionstudies.org/data-center/\n- SCOTUS v. American Public Opinion (July 2020): https://www.hks.harvard.edu/faculty-research/policy-topics/democracy-governance/us-supreme-court-v-american-public-opinion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksonwalters%2Fscotus-v-public","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacksonwalters%2Fscotus-v-public","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksonwalters%2Fscotus-v-public/lists"}