GithubHelp home page GithubHelp logo

Comments (2)

justheuristic avatar justheuristic commented on June 18, 2024

Hi!

Disclaimer: i'm not very well versed with metric learning tasks. An expert's opinion should be preferable to mine.

(0) Not all BERT-like models are created equal :) There is a particular subtype that is aimed at embedding whole sentences -- no guarantees, but it might be worth trying. Here's a lib that has a bunch of them: https://github.com/UKPLab/sentence-transformers
(1) dim=16 seems too small based on my (limited) experience. The actual dimension should depend on the number of classes, but last time I was working on a similar architecture for retrieval, the optimal dimensions were in 128-1024 range
(2) If the dataset is large enough (so, tens of thousands, rather than hundreds), it is usually beneficial to also fine-tune BERT layers with a small learning rate. In that case, you can worry less about the architecture

from nlp_course.

maiiabocharova avatar maiiabocharova commented on June 18, 2024

Hi!

Disclaimer: i'm not very well versed with metric learning tasks. An expert's opinion should be preferable to mine.

(0) Not all BERT-like models are created equal :) There is a particular subtype that is aimed at embedding whole sentences -- no guarantees, but it might be worth trying. Here's a lib that has a bunch of them: https://github.com/UKPLab/sentence-transformers (1) dim=16 seems too small based on my (limited) experience. The actual dimension should depend on the number of classes, but last time I was working on a similar architecture for retrieval, the optimal dimensions were in 128-1024 range (2) If the dataset is large enough (so, tens of thousands, rather than hundreds), it is usually beneficial to also fine-tune BERT layers with a small learning rate. In that case, you can worry less about the architecture

Thanks a lot for answering! I used sentence-transformers. Also had the idea that it would be better than using just Bert. For starters I used miniLM-v6 as it was quick to train.

I have 140k datapoints in datasets. Number of classes is 6, but 80% of the datapoints belong to 1 class — class "others" and to most under-represented class belong only 0.5% of datapoints. The thing is that after training the embeddings I need to somehow use them to later classify new sentences. And here is where I am stuck. I thought about using SVM but it will not work with such high dimensional datapoints. I am now thinking about using a fully connected network with a couple of dense layers in order to classify datapoints according to embeddings. But that would once again leave me with a problem of very imbalanced dataset.

from nlp_course.

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.