sentence-transformers How to use sparse-encoder-testing/splade-bert-tiny-nq with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("sparse-encoder-testing/splade-bert-tiny-nq")
sentences = [
"who are the dancers in the limp bizkit rollin video",
"Voting age Before the Second World War, the voting age in almost all countries was 21 years or higher. Czechoslovakia was the first to reduce the voting age to 20 years in 1946, and by 1968 a total of 17 countries had lowered their voting age.[1] Many countries, particularly in Western Europe, reduced their voting ages to 18 years during the 1970s, starting with the United Kingdom (1969),[2] with the United States (26th Amendment) (1971), Canada, West Germany (1972), Australia (1974), France (1974), and others following soon afterwards. By the end of the 20th century, 18 had become by far the most common voting age. However, a few countries maintain a voting age of 20 years or higher. It was argued that young men could be drafted to go to war at 18, and many people felt they should be able to vote at the age of 18.[3]",
"Rollin' (Limp Bizkit song) The music video was filmed atop the South Tower of the former World Trade Center in New York City. The introduction features Ben Stiller and Stephen Dorff mistaking Fred Durst for the valet and giving him the keys to their Bentley Azure. Also making a cameo is break dancer Mr. Wiggles. The rest of the video has several cuts to Durst and his bandmates hanging out of the Bentley as they drive about Manhattan. The song Ben Stiller is playing at the beginning is \"My Generation\" from the same album. The video also features scenes of Fred Durst with five girls dancing in a room. The video was filmed around the same time as the film Zoolander, which explains Stiller and Dorff's appearance. Fred Durst has a small cameo in that film.",
"Eobard Thawne When Thawne reappears, he murders the revived Johnny Quick,[9] before proceeding to trap Barry and the revived Max Mercury inside the negative Speed Force. Thawne then attempts to kill Wally West's children through their connection to the Speed Force in front of Linda Park-West, only to be stopped by Jay Garrick and Bart Allen. Thawne defeats Jay and prepares to kill Bart, but Barry, Max, Wally, Jesse Quick, and Impulse arrive to prevent the villain from doing so.[8][10] In the ensuing fight, Thawne reveals that he is responsible for every tragedy that has occurred in Barry's life, including the death of his mother. Thawne then decides to destroy everything the Flash holds dear by killing Barry's wife, Iris, before they even met.[10]"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]