English Legal BERT Sentence Embedding Base Cased model

Description

Pretrained Legal BERT Sentence Embedding model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. multi-qa-mpnet-base-dot-v1_legal_finetune is a English model originally trained by oliviamga2.

Download Copy S3 URI

How to use

sent_embeddings = BertSentenceEmbeddings.pretrained("sent_bert_multi_qa_mpnet_base_dot_v1_legal_finetune", "en") \
.setInputCols("sentence") \
.setOutputCol("bert_sentence")

nlp_pipeline = Pipeline(stages=[document_assembler, sentence_detector, sent_embeddings ])
  result = pipeline.fit(data).transform(data)
vval sent_embeddings = BertSentenceEmbeddings.pretrained("sent_bert_multi_qa_mpnet_base_dot_v1_legal_finetune", "en")
.setInputCols("sentence")
.setOutputCol("bert_sentence")

val pipeline = new Pipeline().setStages(Array(document_assembler, sentence_detector, sent_embeddings ))

Model Information

Model Name: sent_bert_multi_qa_mpnet_base_dot_v1_legal_finetune
Compatibility: Spark NLP 4.3.2+
License: Open Source
Edition: Official
Input Labels: [sentence]
Output Labels: [bert_sentence]
Language: en
Size: 409.0 MB
Case sensitive: true

References

  • https://huggingface.co/oliviamga2/multi-qa-mpnet-base-dot-v1_legal_finetune
  • https://www.SBERT.net
  • https://seb.sbert.net?model_name=%7BMODEL_NAME%7D