Giter VIP home page Giter VIP logo

bert_binary_text_classification's Introduction

Update

Update 2. Check out SimpleTransformers if you want a ready to use (3 lines total for initializing, training, and evaluating) library. Currently supports BERT, RoBERTa, XLM, XLNet, and DistilBERT models for binary and multiclass classification.

Update 1. In light of the update to the library used in this repo (HuggingFace updated the pytorch-pretrained-bert library to pytorch-transformers), I have written a new guide as well as a new repo. I highly recommend using those instead as the code has been cleaned up both on my end and in the Pytorch-Transformers library, greatly streamlining the whole process. Also, any updates and fixes will primarily be for the updated versions. The new repo also supports XLNet, XLM, and RoBERTa models out of the box, in addition to BERT, as of September 2019.

Binary Text Classification with BERT

Accompanying code for the Medium article found at https://medium.com/@chaturangarajapakshe/a-simple-guide-on-using-bert-for-text-classification-bbf041ac8d04.

Important!

This repository was not meant to be a standalone guide to using BERT. It was originally created to accompany the article above.
If you are using this repo to set up BERT and you run into any issues, I highly recommend that you go through the article as it explains things in more detail.
Even if you don't run into problems, the article should give a better picture of how I did things, and why I chose to do it that way. Gaining that perspective may help you to adapt this code to your project in a more suitable and/or efficient manner.

Happy coding!

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.