Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

tomaarsen
/
bert-base-nq

Sentence Similarity
sentence-transformers
Safetensors
English
bert
feature-extraction
Generated from Trainer
dataset_size:100231
loss:CachedMultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Model card Files Files and versions
xet
Community

Instructions to use tomaarsen/bert-base-nq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use tomaarsen/bert-base-nq with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("tomaarsen/bert-base-nq")
    
    sentences = [
        "who ordered the charge of the light brigade",
        "Charge of the Light Brigade The Charge of the Light Brigade was a charge of British light cavalry led by Lord Cardigan against Russian forces during the Battle of Balaclava on 25 October 1854 in the Crimean War. Lord Raglan, overall commander of the British forces, had intended to send the Light Brigade to prevent the Russians from removing captured guns from overrun Turkish positions, a task well-suited to light cavalry.",
        "UNICEF The United Nations International Children's Emergency Fund was created by the United Nations General Assembly on 11 December 1946, to provide emergency food and healthcare to children in countries that had been devastated by World War II. The Polish physician Ludwik Rajchman is widely regarded as the founder of UNICEF and served as its first chairman from 1946. On Rajchman's suggestion, the American Maurice Pate was appointed its first executive director, serving from 1947 until his death in 1965.[5][6] In 1950, UNICEF's mandate was extended to address the long-term needs of children and women in developing countries everywhere. In 1953 it became a permanent part of the United Nations System, and the words \"international\" and \"emergency\" were dropped from the organization's name, making it simply the United Nations Children's Fund, retaining the original acronym, \"UNICEF\".[3]",
        "Marcus Jordan Marcus James Jordan (born December 24, 1990) is an American former college basketball player who played for the UCF Knights men's basketball team of Conference USA.[1] He is the son of retired Hall of Fame basketball player Michael Jordan."
    ]
    embeddings = model.encode(sentences)
    
    similarities = model.similarity(embeddings, embeddings)
    print(similarities.shape)
    # [4, 4]
  • Notebooks
  • Google Colab
  • Kaggle
bert-base-nq
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
tomaarsen's picture
tomaarsen HF Staff
Update README.md
86bc0f7 verified over 1 year ago
  • 1_Pooling
    Add new SentenceTransformer model over 1 year ago
  • .gitattributes
    1.52 kB
    initial commit over 1 year ago
  • README.md
    101 kB
    Update README.md over 1 year ago
  • config.json
    684 Bytes
    Add new SentenceTransformer model over 1 year ago
  • config_sentence_transformers.json
    219 Bytes
    Add new SentenceTransformer model over 1 year ago
  • model.safetensors
    438 MB
    xet
    Add new SentenceTransformer model over 1 year ago
  • modules.json
    242 Bytes
    Add new SentenceTransformer model over 1 year ago
  • sentence_bert_config.json
    56 Bytes
    Add new SentenceTransformer model over 1 year ago
  • special_tokens_map.json
    132 Bytes
    Add new SentenceTransformer model over 1 year ago
  • tokenizer.json
    712 kB
    Add new SentenceTransformer model over 1 year ago
  • tokenizer_config.json
    1.25 kB
    Add new SentenceTransformer model over 1 year ago
  • vocab.txt
    232 kB
    Add new SentenceTransformer model over 1 year ago