Model reference · open weights
physbert_cased is an open-weight embedding model from thellert. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | thellert |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 109M |
| Context | 512 tokens |
| Runs with | transformers |
| Released | 2024-08-19 |
| Popularity | 588 downloads / month |
| Licence | Unknown |
About
PhysBERT is a specialized text embedding model for physics, designed to improve information retrieval, citation classification, and clustering of physics literature. Trained on 1.2 million physics papers, it outperforms general-purpose models in physics-specific tasks.
PhysBERT is a BERT-based text embedding model for physics, fine-tuned using SimCSE for optimized physics-specific performance. This model enables efficient retrieval, categorization, and analysis of physics literature, achieving higher relevance and accuracy on domain-specific NLP tasks. The uncased version can be found here.
Trained on a 40GB corpus from arXiv’s physics publications, consisting of 1.2 million documents, refined for scientific accuracy.
The model was pre-trained using Masked Language Modeling (MLM) and fine-tuned with SimCSE for sentence embeddings.
from transformers import AutoTokenizer, AutoModel
import torch
# Load PhysBERT tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("thellert/physbert_cased")
model = AutoModel.from_pretrained("thellert/physbert_cased")
# Sample text to embed
sample_text = "Electrons exhibit both particle and wave-like behavior."
# Tokenize the input text and pass it through the model
inputs = tokenizer(sample_text, return_tensors="pt")
outputs = model(**inputs)
# Extract the token embeddings
token_embeddings = outputs.last_hidden_state
# Drop CLS and SEP tokens, then take the mean for the sentence embedding
token_embeddings = token_embeddings[:, 1:-1, :]
sentence_embedding = token_embeddings.mean(dim=1)
If you find this work useful please consider citing the following paper:
@article{10.1063/5.0238090,
author = {Hellert, Thorsten and Montenegro, João and Pollastro, Andrea},
title = "{PhysBERT: A text embedding model for physics scientific literature}",
journal = {APL Machine Learning},
volume = {2},
number = {4},
pages = {046105},
year = {2024},
month = {10},
issn = {2770-9019},
doi = {10.1063/5.0238090},
url = {https://doi.org/10.1063/5.0238090},
eprint = {https://pubs.aip.org/aip/aml/article-pdf/doi/10.1063/5.0238090/20227307/046105\_1\_5.0238090.pdf},
}
Thorsten Hellert, João Montenegro, Andrea Pollastro
Thorsten Hellert, Lawrence Berkeley National Laboratory, thellert@lbl.gov
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys physbert-cased for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (physbert-cased below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"physbert-cased","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.