Git Product home page Git Product logo

Comments (4)

kpe avatar kpe commented on August 11, 2024

@muhammadfahid51 - have you took a look at the examples, i.e. https://github.com/kpe/bert-for-tf2/blob/master/examples/tpu_movie_reviews.ipynb

I'm not sure whether doing something fancy on top of BERT when fine-tuning brings much (compared to just classifying on the [CLS] activations). I believe it is rather important to try not over-fitting and find a good learning rate schedule.

from bert-for-tf2.

kpe avatar kpe commented on August 11, 2024

@muhammadfahid51 - what do you mean by "model is training" - does the loss drop over time? What hyper parameters do you use? What is your kernel size in the CNN and how many CNN layers do you use? And how large is your dataset?
I don't see why your model above should not work if using proper hyper-parameters.

from bert-for-tf2.

muhammadfahid51 avatar muhammadfahid51 commented on August 11, 2024

@kpe Hey,
Training loss does not drop over time and neither the validation loss. About parameters I have changed them alot. Like tried different number of layers, filters, regularization parameters etc but to no avail.
But I think the problem was something else. My data is in Urdu Language and it has got 10k samples of 3 classes with 50(Positive), 30(Negative) and 20(Neutral) percent distribution. I tried the same model on imdb data and it worked well.
But one tweak that remains is,
How does bert handles unknown words. Does it assign all of them to '[UNK]' and then learns them while training or is there some other technique ?

from bert-for-tf2.

kpe avatar kpe commented on August 11, 2024

@muhammadfahid51 - I believe the BERT models were pre-trained on English only. So until there is a multilingual pre-trained model you might have to pre-train from scratch yourself. To check how the tokenization works with your language, you could tokenize and convert the tokens to ids, and then back.
Currently bert-for-tf2 does not have an example/tools for pre-training from scratch. When pre-training from scratch it might be easier using the workflow from the original google-research/bert. Once you have the pre-trained weights, you could fine-tune with bert-for-tf2.

from bert-for-tf2.

Related Issues (20)

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.