Description
Pretrained BertEmbeddings model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. FRPile_GPL
is a English model originally trained by DragosGorduza
.
How to use
documentAssembler = DocumentAssembler() \
.setInputCols(["text"]) \
.setOutputCols("document")
tokenizer = Tokenizer() \
.setInputCols("document") \
.setOutputCol("token")
bert_loaded = BertEmbeddings.pretrained("bert_embeddings_frpile_gpl","en") \
.setInputCols(["document", "token"]) \
.setOutputCol("embeddings") \
.setCaseSensitive(True)
pipeline = Pipeline(stages=[documentAssembler, tokenizer, bert_loaded])
data = spark.createDataFrame([["I love Spark NLP"]]).toDF("text")
result = pipeline.fit(data).transform(data)
val documentAssembler = new DocumentAssembler()
.setInputCols(Array("text"))
.setOutputCols(Array("document"))
val tokenizer = new Tokenizer()
.setInputCols("document")
.setOutputCol("token")
val bert_loaded = BertEmbeddings.pretrained("bert_embeddings_frpile_gpl","en")
.setInputCols(Array("document", "token"))
.setOutputCol("embeddings")
.setCaseSensitive(true)
val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, bert_loaded))
val data = Seq("I love Spark NLP").toDS.toDF("text")
val result = pipeline.fit(data).transform(data)
Model Information
Model Name: | bert_embeddings_frpile_gpl |
Compatibility: | Spark NLP 5.1.0+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [document, token] |
Output Labels: | [bert] |
Language: | en |
Size: | 1.3 GB |
Case sensitive: | true |
References
- https://huggingface.co/DragosGorduza/FRPile_GPL
- https://www.SBERT.net
- https://www.SBERT.net
- https://www.SBERT.net
- https://seb.sbert.net?model_name=%7BMODEL_NAME%7D