
## Model Details

This is a fine-tuned version of the [MatBERT](https://github.com/lbnlp/MatBERT) model intended to perform band gap classification.

## How to Use

The model takes as input text-based descriptions generated using the [Robocrystallographer](https://github.com/hackingmaterials/robocrystallographer) library.
```python
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

```bibtex
@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}
}
```
{"language": ["en"], "license": "mit", "library_name": "transformers", "pipeline_tag": "text-classification"}
transformers pytorch bert text-classification en arxiv:2303.12188 license:mit autotrain_compatible endpoints_compatible region:us
TAGS
#transformers #pytorch #bert #text-classification #en #arxiv-2303.12188 #license-mit #autotrain_compatible #endpoints_compatible #region-us 


## 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.





## 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.
TAGS
#transformers #pytorch #bert #text-classification #en #arxiv-2303.12188 #license-mit #autotrain_compatible #endpoints_compatible #region-us 
 ## 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.
TAGS
#transformers #pytorch #bert #text-classification #en #arxiv-2303.12188 #license-mit #autotrain_compatible #endpoints_compatible #region-us 
## 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.