Coder Social home page Coder Social logo

bert-encoder's Introduction

bert-encoder

Usage

from bert_encoder import BertEncoder
be = BertEncoder("/path/to/pretrain_bert_model")
be.encode(["你好", "你在哪"])

output

[array([[-0.43364248,  0.41179657, -0.32683408, ...,  0.2388876 ,
         0.2813817 , -0.12212703],
       [-0.3853165 ,  0.30760592, -0.3487961 , ..., -0.02057578,
        -0.21075164, -0.4568899 ]], dtype=float32), array([[-0.43364248,  0.41179657, -0.32683408, ...,  0.2388876 ,
         0.2813817 , -0.12212703],
       [-0.1804257 ,  0.7799143 , -0.19864915, ..., -0.26258343,
         0.01706939, -0.6424839 ],
       [-0.45424426,  0.5611929 ,  0.1049192 , ...,  0.31221464,
         0.19015062, -0.10684527]], dtype=float32)]

Environment

python 3.5+

Installation

cd bert-encoder
python setup install

bert-encoder's People

Contributors

seanlee97 avatar

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.