GithubHelp home page GithubHelp logo

heeh / legal_advice Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 162.82 MB

Legal Taxonomy (https://taxonomy.legal/) Classifier on Reddit /r/legaladvice

Jupyter Notebook 100.00%
classifier reddit scikit-learn logisticregression glove-embeddings tf-idf

legal_advice's Introduction

Test Image 1

Introduction

  • This program classifies legal issues into a binary value for each National Subject Matter Index (NSMI). (https://nsmi.lsntap.org/browse-v2) "Category" means 20 indexes. "Class" means sub categories under the category.

Data

Preprocessing

  • Each article has a binary value(0 or 1) that indicates if this article is related to a specific legal class.
  • We ignore unlabeled entries when constructing a model.
  • Among 100+ classes from NSMI-v2, we extracted 36 classes which has more than 10 positive submissions.
  • After getting the classifier, we chose 16 classes that has reasonable recall.

Classifier

  • First, the program converts each text into an tf-idf vector.
  • After getting the vectors, we apply sklearn LogisticRegression model with L1 loss.
  • We predict the model with 10-fold cross-validation.

Test

  • We apply the classifier to the 900,000 submissions on reddit data.
  • The classifier produces hard and soft labels.
  • We get the final prevalence using freq-e (https://github.com/slanglab/freq-e)

legal_advice's People

Contributors

heeh avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.