Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchical pooling #39

Closed
lambdaofgod opened this issue Mar 2, 2021 · 2 comments
Closed

Hierarchical pooling #39

lambdaofgod opened this issue Mar 2, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@lambdaofgod
Copy link

Could you say something more about hierarchical pooling?
I am interested in this feature, but I'm not sure what you mean.
I can try to implement this if given some guidance.

@oborchers
Copy link
Owner

oborchers commented Apr 10, 2021

Hi @lambdaofgod ! Thanks for your interest! Hierarchical pooling means averaging over a subspan of the original tokens. For example:

Hello - how - are - you - doing
avg1: (hello - how - are) / 3
avg2: (how - are - you) / 3
vec: (avg1 + avg2) / 2

I added this feature a while on the dev branch, but have to admit that the branch is somewhat abandoned.
https://github.com/oborchers/Fast_Sentence_Embeddings/blob/develop/fse/test/test_pooling.py
https://github.com/oborchers/Fast_Sentence_Embeddings/blob/develop/fse/models/pooling.py

The biggest problem was to get a good inheritance structure for the Cython files, so that there is only one core-routine and the internal compositional methods can be altered by model.

@oborchers oborchers added the enhancement New feature or request label Apr 14, 2021
@oborchers
Copy link
Owner

Please see discussion #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants