sentence-transformers How to use smikulas/MNLP_M3_document_encoder with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("smikulas/MNLP_M3_document_encoder")
sentences = [
"Atherosclerosis and coronary heart disease are examples of what type of body system disease?",
"Diseases of the cardiovascular system are common and may be life threatening. Examples include atherosclerosis and coronary heart disease. A healthy lifestyle can reduce the risk of such diseases developing. This includes avoiding smoking, getting regular physical activity, and maintaining a healthy percent of body fat.",
"Osmosis Osmosis is the diffusion of water through a semipermeable membrane according to the concentration gradient of water across the membrane. Whereas diffusion transports material across membranes and within cells, osmosis transports only water across a membrane and the membrane limits the diffusion of solutes in the water. Osmosis is a special case of diffusion. Water, like other substances, moves from an area of higher concentration to one of lower concentration. Imagine a beaker with a semipermeable membrane, separating the two sides or halves (Figure 3.21). On both sides of the membrane, the water level is the same, but there are different concentrations on each side of a dissolved substance, or solute, that cannot cross the membrane. If the volume of the water is the same, but the concentrations of solute are different, then there are also different concentrations of water, the solvent, on either side of the membrane.",
"Circadian rhythms are regular changes in biology or behavior that occur in a 24-hour cycle. In humans, for example, blood pressure and body temperature change in a regular way throughout each 24-hour day. Animals may eat and drink at certain times of day as well. Humans have daily cycles of behavior, too. Most people start to get sleepy after dark and have a hard time sleeping when it is light outside. In many species, including humans, circadian rhythms are controlled by a tiny structure called the biological clock . This structure is located in a gland at the base of the brain. The biological clock sends signals to the body. The signals cause regular changes in behavior and body processes. The amount of light entering the eyes helps control the biological clock. The clock causes changes that repeat every 24 hours."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]