Git Product home page Git Product logo

electra_small's Introduction

Electra_small

Train a small Electra from scratch and fine tune it with GLUE(SST-2) and with ImDb data. After getting the result, compare it with Bert.

Table of Contents

Install

    $ git clone https://github.com/LiZongyue/Electra_small.git
    $ cd ~/Electra_small
    $ pip install .

Train Electra from Scratch

Train_from_Scratch
Before running the pre-training example, you should get a file that contains text on which the language model will be trained. A good example of such text is the WikiText-103 dataset. Download WikiText.raw for the example.

Fine Tune the trained Electra_small on GLUE tasks for sequence classification

fine-tune_GLUE
The General Language Understanding Evaluation (GLUE) benchmark is a collection of nine sentence- or sentence-pair language understanding tasks for evaluating and analyzing natural language understanding systems.

Accuracy of SST-2 classification : 96.87%

For more detail about the dataset and how to run the example, click here

Fine Tune the pretrained Electra_base on imdb unsupervised dataset

fine-tune_pretrained_electra
This example could also be called as post pre-training Electra. The Large Movie Review Dataset is for fine-tuning the pretrained Electra-Base. In this task, 50k data samples for unsupervised learning will be used. The data directory is ~/aclImdb/train/unsup/ once the dataset is downloaded through this link.

Fine Tune the post pretrained Electra on Imdb sentiment classification dataset

fine-tune_Imdb
In this example, data supplier is as same as Fine Tune the pretrained Electra_base on imdb unsupervised dataset. The data directory is ~/aclImdb/train/pos/, ~/aclImdb/train/neg/, ~/aclImdb/test/pos/ and ~/aclImdb/test/neg/ once the dataset is downloaded through this link. Use Data Generator to generate the wohle dataset which could be used directly by the script

Ablation Experiment of Bert

ablation-Bert
In this example, there are two scripts running on Bert. First uses the unsupvised dataset of ImDb to fine tune a pre-trained base Bert, second uses the sentiment classification dataset of ImDb to do the Ablation experiment to compare with Electra.

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.