Coder Social home page Coder Social logo

sagorbrur / bangla-bert Goto Github PK

View Code? Open in Web Editor NEW
72.0 6.0 20.0 4.18 MB

Bangla-Bert is a pretrained bert model for Bengali language

Home Page: https://huggingface.co/sagorsarker/bangla-bert-base

License: MIT License

Jupyter Notebook 100.00%
nlp bert transformers lm bangla bangla-nlp

bangla-bert's Introduction

Hi there ๐Ÿ‘‹

This is Sagor Sarker

An enthusiastic NLP, AI, ML learner

bangla-bert's People

Contributors

sagorbrur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bangla-bert's Issues

Some weights of the model checkpoint at sagorsarker/bangla-bert-base were not used when initializing BertModel

Some weights of the model checkpoint at sagorsarker/bangla-bert-base were not used when initializing BertModel: ['cls.predictions.bias', 'cls.predictions.decoder.weight', 'cls.seq_relationship.weight', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.dense.weight', 'cls.seq_relationship.bias']

  • This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
  • This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).

CODE Portion:

class BertClassifier(th.nn.Module):

def __init__(self, pretrained_model='sagorsarker/bangla-bert-base', nb_class=20):
    super(BertClassifier, self).__init__()
    self.nb_class = nb_class
    self.tokenizer = AutoTokenizer.from_pretrained(pretrained_model)
    self.bert_model = AutoModel.from_pretrained(pretrained_model)
    self.feat_dim = list(self.bert_model.modules())[-2].out_features
    self.classifier = th.nn.Linear(self.feat_dim, nb_class)

def forward(self, input_ids, attention_mask):
    cls_feats = self.bert_model(input_ids, attention_mask)[0][:, 0]
    cls_logit = self.classifier(cls_feats)
    return cls_logit

PRE_TRAINED_MODEL_NAME = 'sagorsarker/bangla-bert-base'

model = BertClassifier(pretrained_model=PRE_TRAINED_MODEL_NAME, nb_class=nb_class)

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.