Skip to content

Latest commit

 

History

History
335 lines (288 loc) · 15.7 KB

legal_advice.org

File metadata and controls

335 lines (288 loc) · 15.7 KB

Predicting Legal Needs

1 Motivation

1.1 Opening Question

figs/pt.png

1.2 Questions I

  • Is it a legal issue?
  • What kind of legal issue is it?
  • How to deal with it?

1.3 Annual Submissions(2010 - 2019)

figs/annual_num_docs.png

1.4 Monthly Submissions(01/2019 - 03/2020)

figs/monthly_num_docs.png

1.5 Questions II

  • Can Reddit data shed a light to legal trend?
  • Are there seasonality effects?
  • How does society react to pandemic?

2 Data

2.1 National Subject Matter Index(NSMI v2)

2.2 National Subject Matter Index(NSMI v2)

file:figs/subclass.png

2.3 Training Data

figs/learned_hands.png

2.4 Training Data

figs/trainingdata.png

2.5 Prevalence

Class# pos# docsPrevalence
HO-063416620.0205
IM-003619640.0183
MO-0036614290.2561
TO-0023012570.1830
TR-0026020060.1296
TR-012218270.0120
TR-053118160.0171
WO-0038719910.1944

2.6 Prevalence(cont.)

Class# pos# docsPrevalence
BU-009315900.0585
CO-0010611640.0911
CR-0030216790.1799
ED-002418130.0132
ES-007819440.0401
FA-0035720420.1748
HE-0012219000.0642
HO-0055021320.2580

2.7 Test Data

  • Legal Advice Subreddit($/r/legal\_advice$)
  • First submission: April 20, 2010
  • 906,693 submissions(04/2010 - 03/2020)
  • 21,490 / month (01/2019 - 03/2020)
  • 5,005 / week (01/2020 - 03/2020)
  • 740 / day (02/2020 - 03/2020)

2.8 Pushshift API

import requests

# Retrieve 1000 submissions with specified fields
url = "https://api.pushshift.io/reddit/search/       \
       submission/?subreddit=legaladvice&            \
       fields=id,created_utc,title,selftext&         \
       size=1000&after=2020-01-01&before=2020-01-31"
subs = requests.get(url)

(http://github.com/heeh/subreddit_downloader/sample.py)

3 Classifier

3.1 TF-IDF L1

  • Input representation: TF-IDF Dimension: 90k - 160k
  • 10-fold validation
  • Class weight: balanced
  • Logistic regression with cross entropy loss and L1 regularization

$$score(λ) = loss(\mathbf{x}de,\mathbf{y}de, \mathbf{\hat{θ}}): \mathbf{\hat{θ}} = \argmax\mathbf{θ} log P\mathbf{θ}(\mathbf{y}tr|\mathbf{x}tr) - λ | \mathbf{θ} |$$

  • Grid search over powers of 2(2-12, 2-11, … , 2-1)

3.2 Comparison

ClassifierAcc.Prec.Rec.F1log_lossbrier
TF-IDF L10.970.520.410.460.08290.0186
TF-IDF L20.970.550.220.280.07590.0194
GloVe(50) L10.930.250.540.320.20490.0521
GloVe(50) L20.920.240.560.310.20810.0571
GloVe(300)L10.960.370.520.420.10860.0273
GloVe(300)L20.970.400.510.440.09680.0242

3.3 Recall Top 10

file:figs/top10.png

3.4 Recall Distribution

file:figs/recall_dist.png

3.5 Input

figs/pt.png

3.6 Output

ClassPrediction
TR-00-00-00-000.9561
CO-00-00-00-000.6452
MO-00-00-00-000.3711
BU-00-00-00-000.0486
TO-00-00-00-000.0211
FA-00-00-00-000.0131
CR-00-00-00-000.0129
TR-01-00-00-000.0087
HO-06-00-00-000.0061
ED-00-00-00-000.0043

4 Prevalence Estimation

4.1 Freq-e

file:figs/freq_e.jpeg (Katherine and O’Connor, 2018)

4.2 Monthly Prevalence

figs/monthly_1.png

  • WO-00: Work and Employment Law
  • HO-00: Housing
  • HO-06: Renting or leasing a home
  • HE-00: Health

4.3 Weekly Prevalence

figs/weekly_1.png

  • WO-00: Work and Employment Law
  • HO-00: Housing
  • HO-06: Renting or leasing a home
  • HE-00: Health

4.4 Daily Prevalence

figs/daily_1.png

  • WO-00: Work and Employment Law
  • HO-00: Housing
  • HO-06: Renting or leasing a home
  • HE-00: Health

4.5 Sample - Work and Employment Law

2020-W11 (03/09 - 03/16)
1. TX - property manager showing home while occupying space amid covit-19 pandemic and don’t feel safe whatsoever. Do I have a right of refusal or reject visits based on those grounds without penalty?
2. Can employees sue employer for not allowing them to work from home during the coronavirus pandemic? (Maryland)
3. [OH] My wife is being told she has to work in an office building without running water, in the middle of a pandemic and state emergency. How can this be legal?
4. OSHA question regarding pandemic
5. [Ohio, US] Employer allowing staff with children to telecommute, requiring staff without children to be present in office during pandemic concerns.
2020-W12 (03/16 - 03/23)
1. Started a new job during COVID-19 pandemic and have questions about legal rights
2. Self-employed retailer in Vermont, USA temporarily closes brick and mortar location during virus pandemic, can i collect unemployment and still sell merchandise online?
3. My SO has chronic illness, can he be fired for requesting to work from home during the COVID-19 pandemic?
4. Can I temporarily lay off my employees because of the pandemic? (Ontario)
5. [NJ] Employer is allowing the option to work from home among this COVID-19 pandemic… but will take 40% cut out of our pay if we so choose to work from home.

4.6 Sample - Work and Employment Law

2020-W13 (03/23 - 03/30)
1. Employed as nanny, time off for pandemic, family ignoring me
2. I am an RBT that was told to work in clients home during a national pandemic. I am currently pregnant (high risk), and don’t feel safe entering client homes. Risk of being fired? OHIO
3. Evicted due to being laid off in service industry during pandemic
4. Prior to the pandemic, my employer denied my request to work from home. I have a meeting with an employment attorney. What should I do to get ready?
5. Company is reducing the pay of all it’s employees by 10% due to the pandemic.
2020-W14 (03-30 - 04-06)
1. Can I be fired for taking a leave of absence during this pandemic?
2. Filed for unemployment on the 24th in MD due to the pandemic. Received a letter today.
3. Company changing official pandemic response after a confirmed case at facility
4. Put in my resignation letter (3 month notice) a couple months ago before pandemic hit, now I want my job back, or figure out a way to qualify for unemployment. Options?
5. Access Denied during a pandemic! WTF Really?!

4.7 Summary

  • Provides people better understanding of their issues
  • Helps understand seasonal legal needs
  • Learn how a natural disaster affects legal needs

4.8 Todo

  • Need More labeled data(Currently 16 classes available)
  • Perform the protocol with dataset from other communities (California statewide legal help portal)
  • Build an automated system to improve the model

4.9 Reference

  • Keith, K., & O’Connor, B. (2018). Uncertainty-aware generative models for inferring document class prevalence. In Proceedings of EMNLP.