Skip to content

jgabele/bert-for-inference

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contents

Introduction to inference with BERT

introduction-to-bert.ipynb

Gives an introduction on how to use BERT for inference. Ideal if you want to use BERT for feature extraction.

Predicting stuff with masks

mask-probability.ipynb

Under construction. Code works but needs comments and more explanation.

Try notebooks online with binder

Binder

Local installation

  1. Clone from GitHub
  2. pipenv install inside the cloned directory (where the Pipfile is)
  3. Install the correct torch version for your system. You don't need torchvision. When using pipenv, you'll first have to activate shell and then install torch.
pipenv shell
python -m pip install torch===1.3.1 -f https://download.pytorch.org/whl/torch_stable.html

To run the notebook, simply launch your jupyter notebook, e.g.

pipenv run jupyter notebook

About

A small repo showing how to easily use BERT (or other transformers) for inference

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 100.0%