You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is standard procedure for suggesting a refactor so if this "issue" is not conforming to your guidelines please feel free to immediately close it.
I've recently been tasked with implementing a semantic search functionality on a website and I've decided to use sentence-transformers and train models from scratch in my desired language. I've used OnlineContrastiveLoss as my training objective and the respective evaluation module BinaryClassificationEvaluator to evaluate my models.
While reading the source code for this file out of curiosity a couple of refactoring points come to mind which I would like to bring up here. I'd be happy to submit a PR for these but I just wanted to run these by you first in an issue before getting started on a PR.
which seems to be more efficient, at least at first glance (I haven't performed any benchmarks to know for sure).
Thanks again for your tremendous work! If these look like feasible changes, let me know and I can submit a PR myself. I'd imagine other evaluators could use similar refactors in that case as well.
The text was updated successfully, but these errors were encountered:
Hi (again!),
I'm not sure if this is standard procedure for suggesting a refactor so if this "issue" is not conforming to your guidelines please feel free to immediately close it.
I've recently been tasked with implementing a semantic search functionality on a website and I've decided to use
sentence-transformers
and train models from scratch in my desired language. I've usedOnlineContrastiveLoss
as my training objective and the respective evaluation moduleBinaryClassificationEvaluator
to evaluate my models.While reading the source code for this file out of curiosity a couple of refactoring points come to mind which I would like to bring up here. I'd be happy to submit a PR for these but I just wanted to run these by you first in an issue before getting started on a PR.
Instead of
we could more succinctly have
from_input_examples
:We could instead simply do:
compute_metrics
:Instead of
which can be potentially slow on large batches of data due to the list comprehension, we can just vectorize the operation and do
which seems to be more efficient, at least at first glance (I haven't performed any benchmarks to know for sure).
Thanks again for your tremendous work! If these look like feasible changes, let me know and I can submit a PR myself. I'd imagine other evaluators could use similar refactors in that case as well.
The text was updated successfully, but these errors were encountered: