Skip to content

2022-12-06-legclf_agreement_and_plan_of_reorganization_bert_en #13196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d2bf12a
Add model 2022-12-06-legclf_agreement_and_plan_of_reorganization_bert_en
bunyamin-polat Dec 6, 2022
18fd1ed
Add model 2022-12-06-legclf_deposit_agreement_bert_en
bunyamin-polat Dec 6, 2022
e611527
Add model 2022-12-06-legclf_indemnity_agreement_bert_en
bunyamin-polat Dec 6, 2022
cfb8ea3
Add model 2022-12-06-legclf_investment_advisory_agreement_bert_en
bunyamin-polat Dec 6, 2022
31083eb
Add model 2022-12-06-legclf_option_agreement_bert_en
bunyamin-polat Dec 6, 2022
0442ead
Add model 2022-12-06-legclf_pledge_agreement_bert_en
bunyamin-polat Dec 6, 2022
b70a594
Add model 2022-12-06-legclf_restricted_stock_unit_agreement_bert_en
bunyamin-polat Dec 6, 2022
4d0e25d
Add model 2022-12-06-legclf_revolving_credit_agreement_bert_en
bunyamin-polat Dec 6, 2022
f502631
Add model 2022-12-06-legclf_severance_agreement_bert_en
bunyamin-polat Dec 6, 2022
0cb6fb5
Add model 2022-12-06-legclf_underwriting_agreement_bert_en
bunyamin-polat Dec 6, 2022
6f7c45a
Create 2022-12-06-legclf_agreement_and_plan_of_reorganization_bert_en.md
bunyamin-polat Dec 6, 2022
20432ce
Update 2022-12-06-legclf_deposit_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
d79b3bb
Update 2022-12-06-legclf_indemnity_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
521a633
Update 2022-12-06-legclf_investment_advisory_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
f181b33
Update 2022-12-06-legclf_option_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
2483c36
Update 2022-12-06-legclf_pledge_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
888002e
Update 2022-12-06-legclf_restricted_stock_unit_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
06e91a1
Update 2022-12-06-legclf_revolving_credit_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
1391a16
Update 2022-12-06-legclf_severance_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
68f0e97
Update 2022-12-06-legclf_underwriting_agreement_bert_en.md
bunyamin-polat Dec 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
layout: model
title: Legal Agreement and Plan of Reorganization Document Classifier (Bert Sentence Embeddings)
author: John Snow Labs
name: legclf_agreement_and_plan_of_reorganization_bert
date: 2022-12-06
tags: [en, legal, classification, agreement, plan, reorganizationlicensed, bert, licensed, tensorflow]
task: Text Classification
language: en
edition: Legal NLP 1.0.0
spark_version: 3.0
supported: true
engine: tensorflow
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

The `legclf_agreement_and_plan_of_reorganization_bert` model is a Bert Sentence Embeddings Document Classifier used to classify if the document belongs to the class `agreement-and-plan-of-reorganization` (check [Lawinsider](https://www.lawinsider.com/tags) for similar document type classification) or not (Binary Classification).

Unlike the Longformer model, this model is lighter in terms of inference time.

## Predicted Entities

`agreement-and-plan-of-reorganization`, `other`

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/legal/models/legclf_agreement_and_plan_of_reorganization_bert_en_1.0.0_3.0_1670349241846.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use



<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}

```python

document_assembler = nlp.DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("document")

embeddings = nlp.BertSentenceEmbeddings.pretrained("sent_bert_base_cased", "en")\
.setInputCols("document")\
.setOutputCol("sentence_embeddings")

doc_classifier = legal.ClassifierDLModel.pretrained("legclf_agreement_and_plan_of_reorganization_bert", "en", "legal/models")\
.setInputCols(["sentence_embeddings"])\
.setOutputCol("category")

nlpPipeline = nlp.Pipeline(stages=[
document_assembler,
embeddings,
doc_classifier])

df = spark.createDataFrame([["YOUR TEXT HERE"]]).toDF("text")

model = nlpPipeline.fit(df)

result = model.transform(df)

```

</div>

## Results

```bash

+-------+
|result|
+-------+
|[agreement-and-plan-of-reorganization]|
|[other]|
|[other]|
|[agreement-and-plan-of-reorganization]|

```

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|legclf_agreement_and_plan_of_reorganization_bert|
|Compatibility:|Legal NLP 1.0.0+|
|License:|Licensed|
|Edition:|Official|
|Input Labels:|[sentence_embeddings]|
|Output Labels:|[class]|
|Language:|en|
|Size:|22.8 MB|

## References

Legal documents, scrapped from the Internet, and classified in-house + SEC documents + Lawinsider categorization

## Benchmarking

```bash

precision recall f1-score support

agreement-and-plan-of-reorganization 1.00 1.00 1.00 31
other 1.00 1.00 1.00 35

accuracy 1.00 66
macro-avg 1.00 1.00 1.00 66
weighted-avg 1.00 1.00 1.00 66

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
layout: model
title: Legal Deposit Agreement Document Classifier (Bert Sentence Embeddings)
author: John Snow Labs
name: legclf_deposit_agreement_bert
date: 2022-12-06
tags: [en, legal, classification, agreement, deposit, licensed, bert, tensorflow]
task: Text Classification
language: en
edition: Legal NLP 1.0.0
spark_version: 3.0
supported: true
engine: tensorflow
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

The `legclf_deposit_agreement_bert` model is a Bert Sentence Embeddings Document Classifier used to classify if the document belongs to the class `deposit-agreement` (check [Lawinsider](https://www.lawinsider.com/tags) for similar document type classification) or not (Binary Classification).

Unlike the Longformer model, this model is lighter in terms of inference time.

## Predicted Entities

`deposit-agreement`, `other`

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/legal/models/legclf_deposit_agreement_bert_en_1.0.0_3.0_1670349380582.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use



<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}

```python

document_assembler = nlp.DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("document")

embeddings = nlp.BertSentenceEmbeddings.pretrained("sent_bert_base_cased", "en")\
.setInputCols("document")\
.setOutputCol("sentence_embeddings")

doc_classifier = legal.ClassifierDLModel.pretrained("legclf_deposit_agreement_bert", "en", "legal/models")\
.setInputCols(["sentence_embeddings"])\
.setOutputCol("category")

nlpPipeline = nlp.Pipeline(stages=[
document_assembler,
embeddings,
doc_classifier])

df = spark.createDataFrame([["YOUR TEXT HERE"]]).toDF("text")

model = nlpPipeline.fit(df)

result = model.transform(df)

```

</div>

## Results

```bash

+-------+
|result|
+-------+
|[deposit-agreement]|
|[other]|
|[other]|
|[deposit-agreement]|

```

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|legclf_deposit_agreement_bert|
|Compatibility:|Legal NLP 1.0.0+|
|License:|Licensed|
|Edition:|Official|
|Input Labels:|[sentence_embeddings]|
|Output Labels:|[class]|
|Language:|en|
|Size:|22.7 MB|

## References

Legal documents, scrapped from the Internet, and classified in-house + SEC documents + Lawinsider categorization

## Benchmarking

```bash

precision recall f1-score support

deposit-agreement 0.97 0.97 0.97 36
other 0.98 0.98 0.98 65

accuracy 0.98 101
macro-avg 0.98 0.98 0.98 101
weighted-avg 0.98 0.98 0.98 101

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
layout: model
title: Legal Indemnity Agreement Document Classifier (Bert Sentence Embeddings)
author: John Snow Labs
name: legclf_indemnity_agreement_bert
date: 2022-12-06
tags: [en, legal, classification, agreement, indemnity, licensed, bert, tensorflow]
task: Text Classification
language: en
edition: Legal NLP 1.0.0
spark_version: 3.0
supported: true
engine: tensorflow
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

The `legclf_indemnity_agreement_bert` model is a Bert Sentence Embeddings Document Classifier used to classify if the document belongs to the class `indemnity-agreement` (check [Lawinsider](https://www.lawinsider.com/tags) for similar document type classification) or not (Binary Classification).

Unlike the Longformer model, this model is lighter in terms of inference time.

## Predicted Entities

`indemnity-agreement`, `other`

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/legal/models/legclf_indemnity_agreement_bert_en_1.0.0_3.0_1670349475264.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use



<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}

```python

document_assembler = nlp.DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("document")

embeddings = nlp.BertSentenceEmbeddings.pretrained("sent_bert_base_cased", "en")\
.setInputCols("document")\
.setOutputCol("sentence_embeddings")

doc_classifier = legal.ClassifierDLModel.pretrained("legclf_indemnity_agreement_bert", "en", "legal/models")\
.setInputCols(["sentence_embeddings"])\
.setOutputCol("category")

nlpPipeline = nlp.Pipeline(stages=[
document_assembler,
embeddings,
doc_classifier])

df = spark.createDataFrame([["YOUR TEXT HERE"]]).toDF("text")

model = nlpPipeline.fit(df)

result = model.transform(df)

```

</div>

## Results

```bash

+-------+
|result|
+-------+
|[indemnity-agreement]|
|[other]|
|[other]|
|[indemnity-agreement]|

```

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|legclf_indemnity_agreement_bert|
|Compatibility:|Legal NLP 1.0.0+|
|License:|Licensed|
|Edition:|Official|
|Input Labels:|[sentence_embeddings]|
|Output Labels:|[class]|
|Language:|en|
|Size:|22.7 MB|

## References

Legal documents, scrapped from the Internet, and classified in-house + SEC documents + Lawinsider categorization

## Benchmarking

```bash

precision recall f1-score support

indemnity-agreement 0.88 0.82 0.85 28
other 0.86 0.91 0.89 35

accuracy 0.87 63
macro-avg 0.87 0.87 0.87 63
weighted-avg 0.87 0.87 0.87 63

```
Loading