Model Details
This is a fine-tuned version of the MatBERT model intended to perform band gap classification.
How to Use
The model takes as input text-based descriptions generated using the Robocrystallographer library.
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
id2label = {0: "metal", 1: "nonmetal"}
tokenizer = AutoTokenizer.from_pretrained("korolewadim/matbert-bandgap")
model = AutoModelForSequenceClassification.from_pretrained("korolewadim/matbert-bandgap")
description = "BN is Boron Nitride structured and crystallizes in the hexagonal P6_3/mmc space group. B(1) is bonded in a trigonal planar geometry to three equivalent N(1) atoms. All B(1)–N(1) bond lengths are 1.45 Å. N(1) is bonded in a trigonal planar geometry to three equivalent B(1) atoms."
inputs = tokenizer(description, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class = id2label[logits.argmax().item()]
Citation Information
@misc{korolev2023accurate,
title={Toward Accurate Interpretable Predictions of Materials Properties within Transformer Language Models},
author={Vadim Korolev and Pavel Protsenko},
year={2023},
eprint={2303.12188},
archivePrefix={arXiv},
primaryClass={cond-mat.mtrl-sci}
}
- Downloads last month
- 124
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.