File size: 1,474 Bytes
f7ccf3f
fbdfdb5
 
f7ccf3f
fbdfdb5
 
 
f7ccf3f
fbdfdb5
1eca2bf
fbdfdb5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---

language: en
tags: Text Classification
license: apache-2.0
datasets: 
- batterydata/paper-abstracts
metrics: glue
---


# BatterySciBERT-uncased for Battery Abstract Classification 
**Language model:** batteryscibert-uncased
**Language:** English  
**Downstream-task:** Text Classification
**Training data:** training\_data.csv

**Eval data:** val\_data.csv
**Code:**  See [example](https://github.com/ShuHuang/batterybert) 
**Infrastructure**: 8x DGX A100
## Hyperparameters
```

batch_size = 32

n_epochs = 14

base_LM_model = "batteryscibert-uncased"

learning_rate = 2e-5

``` 
## Performance
```

"Validation accuracy": 97.12,

"Test accuracy": 97.47,

```

## Usage
### In Transformers
```python

from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline

model_name = "batterydata/batteryscibert-uncased-abstract"



# a) Get predictions

nlp = pipeline('text-classification', model=model_name, tokenizer=model_name)

input = {'The typical non-aqueous electrolyte for commercial Li-ion cells is a solution of LiPF6 in linear and cyclic carbonates.'}

res = nlp(input)



# b) Load model & tokenizer

model = AutoModelForSequenceClassification.from_pretrained(model_name)

tokenizer = AutoTokenizer.from_pretrained(model_name)

```
## Authors
Shu Huang: `sh2009 [at] cam.ac.uk`

Jacqueline Cole: `jmc61 [at] cam.ac.uk`

## Citation
BatteryBERT: A Pre-trained Language Model for Battery Database Enhancement