# Legal-doc-processing
[](https://www.python.org/downloads/release/python-380/) [](https://codecov.io/gh/THEOLEX-IO/legal_doc_processing) [](https://travis-ci.org/mtchavez/python-package-boilerplate) [](https://requires.io/github/mtchavez/python-package-boilerplate/requirements?branch=master) [](https://deepsource.io/gh/THEOLEX-IO/legal_doc_processing/?ref=repository-badge)
## What is it ?
<br>
legal-doc-processing is an open source NLP library dedicated to legal documents. It offers a large and various tools to analyse, structure and extract information from legal documents surch as orders, complaints, press release etc etc. <br> <br>
## Installation
<br>
go in your project directory and activate virtual environnement ` cd my-project/ python3 -m venv env source ./env/bin/activate `
then install with pypi ` pip install legal-doc-processing `
or install with git ` git clone https://github.com/THEOLEX-IO/legal_doc_processing.git pip install -r requirements.txt `
at frist usage please write following command to bootstrap the package ` python -c "from legal_doc_processing import boot; boot()" ` this command will download data collections and mandory web assets, it can take 1/2 minutes (depends of your web connection) <br> <br>
## Usage
<br>
There is 2 main modules in legal-doc-processing : - ld for LegalDoc objects ie order, complaint, etc etc official documents - pr for PressRelease objects for legal press release related to each case
so you can ` from legal_doc_processing import * # import all from legal_doc_processing import ld # import legal document module from legal_doc_processing import pr # import press release module ` <br>
### Instanciation youn can init an object in 2 ways. * with text directly ` from legal_doc_processing import ld doc = ld.LegalDoc("this is a document") ` * with path to a file ` doc = ld.read_LegalDoc("this/is/my/file.txt") `
for press release, same pattern: ` from legal_doc_processing import pr press = ld.PressRelease("this is a press release") ` * with path to a file ` press = ld.read_PressRelease("this/is/my/file.txt") `
once instanciated, you can print : ` print(doc) ` <br>
all interessing features are in feature_dict attribute ` print(doc.feature_dict) ` <br>
### Predictions
you can now make predictions : ` defendant = doc.predict("defendant") print(defendant) case = doc.predict("case") print(case) ` <br>
predict method return a something but alson work on the object itself : ` print(doc) print(doc.feature_dict) ` <br>
of course most easy is to predict all : ` features = doc.predict("all") print(features) print(doc) print(doc.feature_dict) ` <br> <br>
## Requirements
<br>
Package requirements are handled using pip. To install them do ` pip install -r requirements.txt ` <br> <br>
## Tests
<br>
Testing is set up using [pytest](http://pytest.org) and coverage is handled with the pytest-cov plugin.
Run your tests with `pytest` in the root directory.
Coverage is ran by default and is set in the `pytest.ini` file. To see an html output of coverage open `htmlcov/index.html` after running the tests. <br> <br>
## Pipe steps:
<br>
Cleaning and feature engineering –> segmentation –> classification –> information extraction <br> <br>
## Licence:
<br>
lorem ipsum <br> <br>
## Getting Help and discussion:
<br>
lorem ipsum <br> <br>
## Contributing:
<br> lorem ipsum <br> <br>
## Documentation:
lorem ipsum <br> <br>
Metadata
Release files for legal-doc-processing 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| legal_doc_processing-1.2.1.tar.gz | 36.3 kB | Without provenance | Details for legal_doc_processing-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| legal_doc_processing-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for legal_doc_processing-1.2.1-py3-none-any.whl |
Total release size: 93.2 kB
Release files / legal_doc_processing-1.2.1.tar.gz
| Download URL | legal_doc_processing-1.2.1.tar.gz |
|---|---|
| Size | 36.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5eac069ca81b3da80ea3bc0a66aa681a8919db798ce26d21f68f168942ea53f1
|
|
BLAKE2b-256 checksum How to use checksums |
999ebb0f0532ae46b7917967d56c26133c561ef0aa7d85d82a50b6a4108d880e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
|
Release files / legal_doc_processing-1.2.1-py3-none-any.whl
| Download URL | legal_doc_processing-1.2.1-py3-none-any.whl |
|---|---|
| Size | 57.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4d6dba44306acd54f5817f8cff4f31b5bde89c4acc7aa5bd42eb2c56d3e9ea0
|
|
BLAKE2b-256 checksum How to use checksums |
b521868c1d746653576086a36134ced534a3bf32eda137a789df6f592e1b8d4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
|
Security for legal-doc-processing 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.