The pipy version of FastBERT
Project description
FastBERT_pypi
The pypi version of FastBERT.
Install
Install fastbert
with pip
.
$ pip install fastbert
Usage
Currently the project only supports single sentence classification, we will add other functions one after another.
from fastbert import FastBERT
# Loading your dataset
labels = ['T', 'F']
sents_train = [
'I am a bad guy!',
'I am a good guy!',
...
]
labels_train = [
'T',
'F',
...
]
# Create and training model
model = FastBERT("google_bert_base_zh", labels=labels, device='cuda:0')
model.fit(
sents_train,
labels_train,
model_saving_path='./fastbert.bin',
)
# Loading model and make inference
model.load_model('./fastbert.bin')
label = model('I am a normal guy!', speed=0.7)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastbert-0.0.2.tar.gz
(28.9 kB
view hashes)
Built Distribution
fastbert-0.0.2-py3-none-any.whl
(48.3 kB
view hashes)