How to use Lysandrec/MNLP_M2_document_encoder with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Lysandrec/MNLP_M2_document_encoder") sentences = [ "Consider the set of points $S = \\{(x,y) : x \\text{ and } y \\text{ are non-negative integers } \\leq n\\}$. Find the number of squares that can be formed with vertices belonging to $S$ and sides parallel to the axes.", "<page_title> Waller Plan </page_title> <path> Waller_Plan > City plan </path> <section_title> City plan </section_title> <content> The plan also designated spaces for a hospital, an academy and university, churches, a courthouse and jail, an armory, and a penitentiary.With the surveying and grid plan completed, Waller and his associates drew up a plat dividing the city blocks into land lots. The first auction of lots was held on August 1, 1839, under a group of live oak trees in what was to be the city's southwestern public square; these trees have since been known as the \"Auction Oaks\". The auction raised $182,585 (equivalent to $5,018,000 in 2022), funds used to pay for the construction of government buildings for the new capital city. </content>", "<page_title> Heilbronn triangle problem </page_title> <path> Heilbronn_triangle_problem > Specific shapes and numbers </path> <section_title> Specific shapes and numbers </section_title> <content> Goldberg (1972) has investigated the optimal arrangements of n {\\displaystyle n} points in a square, for n {\\displaystyle n} up to 16. Goldberg's constructions for up to six points lie on the boundary of the square, and are placed to form an affine transformation of the vertices of a regular polygon. For larger values of n {\\displaystyle n} , Comellas & Yebra (2002) improved Goldberg's bounds, and for these values the solutions include points interior to the square. These constructions have been proven optimal for up to seven points. </content>", "<page_title> 14:9 aspect ratio </page_title> <path> 14:9_aspect_ratio > Mathematics </path> <section_title> Mathematics </section_title> <content> The aspect ratio of 14:9 (1.555...) is the arithmetic mean (average) of 16:9 and 4:3 (12:9), ( ( 16 / 9 ) + ( 12 / 9 ) ) ÷ 2 = 14 / 9 {\\displaystyle ((16/9)+(12/9))\\div 2=14/9} . More practically, it is approximately the geometric mean (the precise geometric mean is ( 16 / 9 ) × ( 4 / 3 ) ≈ 1.5396 ≈ 13.8: 9 {\\displaystyle {\\sqrt {(16/9)\\times (4/3)}}\\approx 1.5396\\approx 13.8:9} ), and in this sense is mathematically a compromise between these two aspect ratios: two equal area pictures (at 16:9 and 4:3) will intersect in a box with aspect ratio the geometric mean, as demonstrated in the image at top (14:9 is just slightly wider than the intersection). In this way 14:9 balances the needs of both 16:9 and 4:3, cropping or distorting both about equally. Similar considerations were used in the choice of 16:9 by the SMPTE, which balanced 2.35:1 and 4:3. </content>" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4]
The community tab is the place to discuss and collaborate with the HF community!