BioBERT Sentence Embeddings (PMC)


This model contains a pre-trained weights of BioBERT, a language representation model for biomedical domain, especially designed for biomedical text mining tasks such as biomedical named entity recognition, relation extraction, question answering, etc. The details are described in the paper “BioBERT: a pre-trained biomedical language representation model for biomedical text mining”.


How to use

embeddings = BertSentenceEmbeddings.pretrained("sent_biobert_pmc_base_cased", "en") \
      .setInputCols("sentence") \
nlp_pipeline = Pipeline(stages=[document_assembler, sentence_detector, embeddings])
pipeline_model =[[""]]).toDF("text"))
result = pipeline_model.transform(spark.createDataFrame(pd.DataFrame({"text": ["I hate cancer, "Antibiotics aren't painkiller""]})))
val embeddings = BertSentenceEmbeddings.pretrained("sent_biobert_pmc_base_cased", "en")
val pipeline = new Pipeline().setStages(Array(document_assembler, sentence_detector, embeddings))
val result =["I hate cancer, "Antibiotics aren't painkiller""].toDS.toDF("text")).transform(data)
import nlu

text = ["I hate cancer", "Antibiotics aren't painkiller"]
embeddings_df = nlu.load('en.embed_sentence.biobert.pmc_base_cased').predict(text, output_level='sentence')


        sentence	                en_embed_sentence_biobert_pmc_base_cased_embeddings

	I hate cancer	                [0.34035101532936096, 0.04413360357284546, -0....
	Antibiotics aren't painkiller	[0.4397204518318176, 0.066007100045681, -0.114...

Model Information

Model Name: sent_biobert_pmc_base_cased
Type: embeddings
Compatibility: Spark NLP 2.6.2
License: Open Source
Edition: Official
Input Labels: [sentence]
Output Labels: [sentence_embeddings]
Language: [en]
Dimension: 768
Case sensitive: true

Data Source

The model is imported from