- LogFiBER Model (BERT based Transformer Model trained on MIMIC clinical dataset )
- How to use LogFiBER model to measure semantic textual similarity.
-
Download LogFiBER Model from Here
-
Extract the zip file
-
Create a python file in the same directory
-
Execute the sample code for measuring semantic similarity
!pip install -U sentence-transformers from sentence_transformers import SentenceTransformer, util model = SentenceTransformer('./LogFiBER/') #LogFiBER is the directory. sentence1 = ['This framework generates embeddings for sentences'] sentence2 = ['The model encodes sentences'] embeddings1 = model.encode(sentence1) embeddings2 = model.encode(sentence2) cosine_scores = util.pytorch_cos_sim(embeddings1, embeddings2) print(cosine_scores)