GithubHelp home page GithubHelp logo

pasinit / legalcrawler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iliaschalkidis/legalcrawler

0.0 0.0 0.0 562 KB

LegalCrawler: A tool for automated scraping of English legal corpora

Python 100.00%

legalcrawler's Introduction

Legal Crawler ๐Ÿ™

A collection of scripts to crawl English legal corpora ๐Ÿ“• from open public domains.

  • The current version supports the following domains:
Corpus Domain Corpus alias
๐Ÿ‡ช๐Ÿ‡บ EU legislation https://eur-lex.europa.eu/ eu
๐Ÿ‡ฌ๐Ÿ‡ง UK legislation https://legislation.gov.uk/ uk
๐Ÿ‡จ๐Ÿ‡ฆ Canadian legislation http://laws.justice.gc.ca/eng/ ca
๐Ÿ‡ฏ๐Ÿ‡ต Japanese legislation http://www.japaneselawtranslation.go.jp/law/ jp
๐Ÿ‡ซ๐Ÿ‡ฎ Finish legislation https://www.finlex.fi/en fi
๐Ÿ‡บ๐Ÿ‡ธ US case law* https://case.law/bulk/download/ us

* In order to use the script for US case law, you need to first apply for a researcher account at https://case.law.

  • For US public filings, e.g., contracts, please use the library OpenEDGAR (https://github.com/LexPredict/openedgar) by LexPredict.
  • Documents are saved in raw text format, amend the code if you wish to better handle metadata, document structure, etc.

โ€ผ๏ธ Disclaimer โ€ผ๏ธ

  • If you aim to use the code, please carefully read the individual license agreements with respect to re-use, re-publication, terms of use, etc. ๐Ÿ“
  • The text cleansing from the original PDF/HTML files is minimal. Consider amending the scripts and/or writing your own post-processing data cleansing process that better fit for each corpus. ๐Ÿšง
  • These scripts aim to give researchers a kick start for scraping legal corpora from public domains. They should not considered a stand-alone qualified solution. ๐Ÿšง

Project Requirements:

Python packages

  • json-lines
  • tqdm
  • beautifulsoup4

Linux packages (command line tools)

The following linux packages are used to process PDF documents:

  • pdftocairo
  • pdftotext
  • mutool
  • gs

Quick start:

Install python requirements:

pip install -r requirements.txt

sudo apt-get install libcairo2-dev
sudo apt-get install libpango1.0-dev
sudo apt-get install -y xpdf
sudo apt-get install mupdf mupdf-tools

Download Canadian legislation

python download_legal_corpora.py --corpus ca

Download EU legislation

python download_legal_corpora.py --corpus eu

Download all (EU, UK, CA, FI, JP, US)

python download_legal_corpora.py --corpus all

legalcrawler's People

Contributors

pasinit 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.