How to use danthepol/MNLP_M2_document_encoder with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("danthepol/MNLP_M2_document_encoder") sentences = [ "What helps an insectivorous plant attract and digest insects?", "This investigation examined the accuracy of several generalizable anthropometric (ANTHRO) and bioelectrical impedance (BIA) regression equations to estimate % body fat (%BF) in women with either upper body (UB) or lower body (LB) fat distribution patterns.", "Bacteria can also be chemotrophs. Chemosynthetic bacteria, or chemotrophs , obtain energy by breaking down chemical compounds in their environment. An example of one of these chemicals broken down by bacteria is nitrogen-containing ammonia. These bacteria are important because they help cycle nitrogen through the environment for other living things to use. Nitrogen cannot be made by living organisms, so it must be continually recycled. Organisms need nitrogen to make organic compounds, such as DNA.", "Insectivorous Plants An insectivorous plant has specialized leaves to attract and digest insects. The Venus flytrap is popularly known for its insectivorous mode of nutrition, and has leaves that work as traps (Figure 31.16). The minerals it obtains from prey compensate for those lacking in the boggy (low pH) soil of its native North Carolina coastal plains. There are three sensitive hairs in the center of each half of each leaf. The edges of each leaf are covered with long spines. Nectar secreted by the plant attracts flies to the leaf. When a fly touches the sensory hairs, the leaf immediately closes. Next, fluids and enzymes break down the prey and minerals are absorbed by the leaf. Since this plant is popular in the horticultural trade, it is threatened in its original habitat." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4]