Git Product home page Git Product logo

distill-grammar's Introduction

License Code style: black GitHub pull requests GitHub issues

distill-grammar

An English language grammar classification model trained on Bert.

Table of contents

Introduction ๐Ÿ”ฅ

An English language grammar classification model trained on Bert. The self-supervised pretrained model is a Bert-base model trained on large corpus of text data. Here we explore the possibility of few shot learning by using the pretrained model to classify the text data. The model is trained on the cola public dataset. It's a dataset that contains a very few labelled sentences from the public domain in English.

Results ๐Ÿ•บ

Performance metrics

MCC Score Accuracy
Results 0.5699 0.8299

Getting started ๐Ÿฅท

Setting up the environment

  • All the development work is done using Python 3.7
  • Install all the necessary dependencies using requirements.txt file. Run pip install -r requirements.txt in terminal
  • Alternatively, set up the environment and train the model using the Dockerfile. Run docker build -f Dockerfile -t <image_name> .

What each file does

  • configs/config.py : This file contains all the configurations for the model.
  • src/dataset.py : This file contains the utility functions for loading the dataset.
  • src/engine.py : This file contains the utilities for training and evaluation.
  • src/train.py : This file is used to train the model.
  • deploy/flask_app.py : This file is used to deploy the model.
  • deploy/convert_onnx.py : This file is used to convert the model to onnx format.
  • saves : This directory contains bert tokenizer configuration, special tokens etc.

Training the model

  • Run python src/train.py in terminal.

distill-grammar's People

Contributors

likith012 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.