Comments (2)
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.
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)
- week_2 seminar.ipynb
- week-5 readme broken link HOT 1
- solution HOT 2
- A question of bow_vocabulary in w2_homework_part1
- Please add reference for negative sampling
- Solution to homework? HOT 1
- requirement.txt HOT 1
- Week02 seminar.ipynb broken link
- 05_seminar: error - unexpected keyword argument 'input_ids'
- the classfication assignment dowload error.
- Missing word in text about residual connections
- Error in the formula from week 1 in lecture slides.
- can't download the data HOT 3
- [question] tools for creating graphics HOT 3
- In pytorch week02_classification seminar bonus part don't work HOT 2
- is there any discussion group? HOT 2
- download data... 403 Forbidden HOT 3
- Homework
- Download uk and ru embeddings by wget command in Google Colab (week01_embeddings/homework) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nlp_course.