NeuML / hgbert-small-embeddings

huggingface.co
Total runs: 80
24-hour runs: 0
7-day runs: 2
30-day runs: -24
Model's Last Updated: July 21 2026
sentence-similarity

Introduction of hgbert-small-embeddings

Model Details of hgbert-small-embeddings

H.G. BERT Embeddings

This is a H.G. BERT Small model fined-tuned using sentence-transformers . It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.

The training dataset was generating using a random sample of Historical English Books title-abstract pairs and query-sentences pairs.

This model was trained using the following three step process.

Unlike other models in this small domain model series, this model did not use distillation. This prevents against data leakage and learning modern similarity patterns. This keeps the model focused on 1899 and prior.

Usage (txtai)

This model can be used to build embeddings databases with txtai for semantic search and/or as a knowledge source for retrieval augmented generation (RAG).

import txtai

embeddings = txtai.Embeddings(path="neuml/hgbert-small-embeddings", content=True)
embeddings.index(documents())

# Run a query
embeddings.search("query to run")
Usage (Sentence-Transformers)

Alternatively, the model can be loaded with sentence-transformers .

from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer("neuml/hgbert-small-embeddings")
embeddings = model.encode(sentences)
print(embeddings)
Usage (Hugging Face Transformers)

The model can also be used directly with Transformers.

from transformers import AutoTokenizer, AutoModel
import torch

# Mean Pooling - Take attention mask into account for correct averaging
def meanpooling(output, mask):
    embeddings = output[0] # First element of model_output contains all token embeddings
    mask = mask.unsqueeze(-1).expand(embeddings.size()).float()
    return torch.sum(embeddings * mask, 1) / torch.clamp(mask.sum(1), min=1e-9)

# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained("neuml/hgbert-small-embeddings")
model = AutoModel.from_pretrained("neuml/hgbert-small-embeddings")

# Tokenize sentences
inputs = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')

# Compute token embeddings
with torch.no_grad():
    output = model(**inputs)

# Perform pooling. In this case, mean pooling.
embeddings = meanpooling(output, inputs['attention_mask'])

print("Sentence embeddings:")
print(embeddings)
Evaluation Results

A BEIR-compatible dataset was generated to facilitate the evaluation process.

Evaluation results are shown below. NDCG is used as the evaluation metric.

Model Parameters NDCG Index Time Search Time Disk
H.G. BERT Small Embeddings 22.7M 50.12 3.82s 0.52s 23 MB
all-MiniLM-L6-v2 22.7M 44.82 4.50s 0.60s 23 MB
DenseOn 149M 47.06 17.52s 1.16s 46 MB
EmbeddingGemma 300M 47.60 24.47s 2.11s 31 MB
Qwen3-Embedding-0.6B 600M 45.75 27.60s 2.98s 62 MB
Qwen3-Embedding-4B 4000M 48.21 129.18s 15.17s 154 MB
Qwen3-Embedding-8B 8000M 47.21 211.95s 24.48s 246 MB

This model is a solid performer at a small size. It beats all models by a comfortable margin including ones with 8 billion parameters!

It can be used in CPU-only setups without trading off much on the accuracy front. It shows how small models can excel at specialized domains, requiring less compute and disk space.

Full Model Architecture
SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'BertModel'})
  (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
More Information

Read more about the model in this article .

Runs of NeuML hgbert-small-embeddings on huggingface.co

80
Total runs
0
24-hour runs
0
3-day runs
2
7-day runs
-24
30-day runs

More Information About hgbert-small-embeddings huggingface.co Model

More hgbert-small-embeddings license Visit here:

https://choosealicense.com/licenses/apache-2.0

hgbert-small-embeddings huggingface.co

hgbert-small-embeddings huggingface.co is an AI model on huggingface.co that provides hgbert-small-embeddings's model effect (), which can be used instantly with this NeuML hgbert-small-embeddings model. huggingface.co supports a free trial of the hgbert-small-embeddings model, and also provides paid use of the hgbert-small-embeddings. Support call hgbert-small-embeddings model through api, including Node.js, Python, http.

hgbert-small-embeddings huggingface.co Url

https://huggingface.co/NeuML/hgbert-small-embeddings

NeuML hgbert-small-embeddings online free

hgbert-small-embeddings huggingface.co is an online trial and call api platform, which integrates hgbert-small-embeddings's modeling effects, including api services, and provides a free online trial of hgbert-small-embeddings, you can try hgbert-small-embeddings online for free by clicking the link below.

NeuML hgbert-small-embeddings online free url in huggingface.co:

https://huggingface.co/NeuML/hgbert-small-embeddings

hgbert-small-embeddings install

hgbert-small-embeddings is an open source model from GitHub that offers a free installation service, and any user can find hgbert-small-embeddings on GitHub to install. At the same time, huggingface.co provides the effect of hgbert-small-embeddings install, users can directly use hgbert-small-embeddings installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

hgbert-small-embeddings install url in huggingface.co:

https://huggingface.co/NeuML/hgbert-small-embeddings

Url of hgbert-small-embeddings

hgbert-small-embeddings huggingface.co Url

Provider of hgbert-small-embeddings huggingface.co

NeuML
ORGANIZATIONS

Other API from NeuML

huggingface.co

Total runs: 1.8K
Run Growth: -1.2K
Growth Rate: -68.09%
Updated:February 06 2025
huggingface.co

Total runs: 1.3K
Run Growth: 1.1K
Growth Rate: 83.05%
Updated:January 27 2025
huggingface.co

Total runs: 1.1K
Run Growth: -170
Growth Rate: -16.18%
Updated:January 27 2025
huggingface.co

Total runs: 919
Run Growth: 137
Growth Rate: 14.91%
Updated:February 21 2023
huggingface.co

Total runs: 853
Run Growth: 250
Growth Rate: 29.31%
Updated:February 21 2023
huggingface.co

Total runs: 521
Run Growth: -99.9K
Growth Rate: -19182.34%
Updated:January 27 2025
huggingface.co

Total runs: 285
Run Growth: 98
Growth Rate: 34.39%
Updated:January 27 2025
huggingface.co

Total runs: 162
Run Growth: 117
Growth Rate: 72.22%
Updated:April 21 2026
huggingface.co

Total runs: 31
Run Growth: 14
Growth Rate: 45.16%
Updated:October 10 2025
huggingface.co

Total runs: 16
Run Growth: 1
Growth Rate: 6.25%
Updated:November 23 2024
huggingface.co

Total runs: 10
Run Growth: 5
Growth Rate: 50.00%
Updated:July 21 2026
huggingface.co

Total runs: 8
Run Growth: -75
Growth Rate: -937.50%
Updated:April 13 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:November 11 2025