Downloads · 30 days
26
3% of all-time downloads
korolewadim/matbert-bandgap
matbert-bandgap is a text classification model from korolewadim. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This is a fine-tuned version of the MatBERT model intended to perform band gap classification.
Downloads · 30 days
26
3% of all-time downloads
All-time downloads
820
Public
Repo size
1.3 GB
Likes
1
Public
Click a slice to open those files.
.bin438 MB · 100%
From the Hugging Face model README
This is a fine-tuned version of the MatBERT model intended to perform band gap classification.
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()]
@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}
}