Giter VIP home page Giter VIP logo

bert's Introduction

Running Google BERT with Multilingual (104 languages) pretrained neural net locally or via Google Colab.


Google BERT official page: https://github.com/google-research/bert

Keras BERT: https://github.com/CyberZHG/keras-bert


I. Run BERT via Google Colab (the simplest way):

  1. Open URL: http://colab.research.google.com/github/blade1780/bert/blob/master/BERT.ipynb
  2. Menu Runtime -> Run All (or press Ctrl+F9)
  3. Agree to reset all runtimes if needed
  4. Wait for downloading model and all imports
  5. Change input strings (sentence, sentence_1 and sentence_2) and press Play button left side to recalculate only current cell (or press Ctrl+Enter)

If use mobile Chrome, it may be need to activate checkbox Full Version in browser settings.

II. Run BERT locally (you need GPU GTX 970 4Gb or higher):

  1. Install TensorFlow from https://www.tensorflow.org/install (install CUDA Toolkit 9.0, cuDNN SDK 7.2 and run)

pip install tensorflow-gpu

  1. Intall Keras

pip install keras

  1. Install Keras BERT

pip install keras-bert

  1. Clone this repository

git clone https://github.com/blade1780/bert

  1. Download and extract pretrained BERT model to folder 'bert': https://storage.googleapis.com/bert_models/2018_11_23/multi_cased_L-12_H-768_A-12.zip (632 Mb)

  2. Navigate to 'bert' folder

cd bert

  1. Run

python BERT.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.