Skip to content

Commit

Permalink
2023-01-29-legclf_master_administrative_services_agreement_bert_en (#…
Browse files Browse the repository at this point in the history
…13427)

* Add model 2023-01-29-legclf_master_administrative_services_agreement_bert_en

* Add model 2023-01-29-legclf_standstill_agreement_bert_en

* Add model 2023-01-29-legclf_adoption_agreement_bert_en

* Add model 2023-01-29-legclf_compensation_agreement_bert_en

* Add model 2023-01-29-legclf_investment_advisory_and_management_agreement_bert_en

* Add model 2023-01-29-legclf_sublicense_agreement_bert_en

* Add model 2023-01-29-legclf_retirement_agreement_bert_en

* Add model 2023-01-29-legclf_noncompetition_agreement_bert_en

* Add model 2023-01-29-legclf_arrangement_agreement_bert_en

* Add model 2023-01-29-legclf_performance_share_award_agreement_bert_en

* Update 2023-01-29-legclf_standstill_agreement_bert_en.md

* Update 2023-01-29-legclf_adoption_agreement_bert_en.md

* Update 2023-01-29-legclf_arrangement_agreement_bert_en.md

* Update 2023-01-29-legclf_compensation_agreement_bert_en.md

* Update 2023-01-29-legclf_investment_advisory_and_management_agreement_bert_en.md

* Update 2023-01-29-legclf_master_administrative_services_agreement_bert_en.md

* Update 2023-01-29-legclf_noncompetition_agreement_bert_en.md

* Update 2023-01-29-legclf_performance_share_award_agreement_bert_en.md

* Update 2023-01-29-legclf_retirement_agreement_bert_en.md

* Update 2023-01-29-legclf_sublicense_agreement_bert_en.md

---------

Co-authored-by: Mary-Sci <meryemyildiz366@gmail.com>
Co-authored-by: Merve Ertas Uslu <67653613+Mary-Sci@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 29, 2023
1 parent 058526d commit fc09276
Show file tree
Hide file tree
Showing 10 changed files with 1,130 additions and 0 deletions.
113 changes: 113 additions & 0 deletions docs/_posts/Mary-Sci/2023-01-29-legclf_adoption_agreement_bert_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
layout: model
title: Legal Adoption Agreement Document Classifier (Bert Sentence Embeddings)
author: John Snow Labs
name: legclf_adoption_agreement_bert
date: 2023-01-29
tags: [en, legal, classification, adoption, agreement, licensed, bert, tensorflow]
task: Text Classification
language: en
edition: Legal NLP 1.0.0
spark_version: 3.0
supported: true
engine: tensorflow
annotator: LegalClassifierDLModel
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

The `legclf_adoption_agreement_bert` model is a Bert Sentence Embeddings Document Classifier used to classify if the document belongs to the class `adoption-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

`adoption-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_adoption_agreement_bert_en_1.0.0_3.0_1674990271078.zip){:.button.button-orange}
[Copy S3 URI](s3://auxdata.johnsnowlabs.com/legal/models/legclf_adoption_agreement_bert_en_1.0.0_3.0_1674990271078.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3}

## 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_adoption_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|
+-------+
|[adoption-agreement]|
|[other]|
|[other]|
|[adoption-agreement]|

```

{:.model-param}
## Model Information

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

## References

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

## Benchmarking

```bash
label precision recall f1-score support
other 0.91 0.97 0.94 98
standstill-agreement 0.93 0.82 0.87 51
accuracy - - 0.92 149
macro-avg 0.92 0.90 0.91 149
weighted-avg 0.92 0.92 0.92 149
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
layout: model
title: Legal Arrangement Agreement Document Classifier (Bert Sentence Embeddings)
author: John Snow Labs
name: legclf_arrangement_agreement_bert
date: 2023-01-29
tags: [en, legal, classification, arrangement, agreement, licensed, bert, tensorflow]
task: Text Classification
language: en
edition: Legal NLP 1.0.0
spark_version: 3.0
supported: true
engine: tensorflow
annotator: LegalClassifierDLModel
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

The `legclf_arrangement_agreement_bert` model is a Bert Sentence Embeddings Document Classifier used to classify if the document belongs to the class `arrangement-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

`arrangement-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_arrangement_agreement_bert_en_1.0.0_3.0_1674990701764.zip){:.button.button-orange}
[Copy S3 URI](s3://auxdata.johnsnowlabs.com/legal/models/legclf_arrangement_agreement_bert_en_1.0.0_3.0_1674990701764.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3}

## 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_arrangement_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|
+-------+
|[arrangement-agreement]|
|[other]|
|[other]|
|[arrangement-agreement]|

```

{:.model-param}
## Model Information

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

## References

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

## Benchmarking

```bash
label precision recall f1-score support
arrangement-agreement 0.97 0.95 0.96 39
other 0.97 0.98 0.97 57
accuracy - - 0.97 96
macro-avg 0.97 0.97 0.97 96
weighted-avg 0.97 0.97 0.97 96
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
layout: model
title: Legal Compensation Agreement Document Classifier (Bert Sentence Embeddings)
author: John Snow Labs
name: legclf_compensation_agreement_bert
date: 2023-01-29
tags: [en, legal, classification, compensation, agreement, licensed, bert, tensorflow]
task: Text Classification
language: en
edition: Legal NLP 1.0.0
spark_version: 3.0
supported: true
engine: tensorflow
annotator: LegalClassifierDLModel
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

The `legclf_compensation_agreement_bert` model is a Bert Sentence Embeddings Document Classifier used to classify if the document belongs to the class `compensation-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

`compensation-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_compensation_agreement_bert_en_1.0.0_3.0_1674990338214.zip){:.button.button-orange}
[Copy S3 URI](s3://auxdata.johnsnowlabs.com/legal/models/legclf_compensation_agreement_bert_en_1.0.0_3.0_1674990338214.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3}

## 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_compensation_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|
+-------+
|[compensation-agreement]|
|[other]|
|[other]|
|[compensation-agreement]|

```

{:.model-param}
## Model Information

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

## References

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

## Benchmarking

```bash
label precision recall f1-score support
compensation-agreement 1.00 0.95 0.97 40
other 0.96 1.00 0.98 55
accuracy - - 0.98 95
macro-avg 0.98 0.97 0.98 95
weighted-avg 0.98 0.98 0.98 95
```
Loading

0 comments on commit fc09276

Please sign in to comment.