Repository navigation
Conversation
|
|
||
|
|
||
| spectral_embed_v2_140m = ModelMeta( | ||
| loader=SpectralEmbedV2Model, |
There was a problem hiding this comment.
Can't you merge v2 version with v1?
There was a problem hiding this comment.
Good call @Samoed. I've refactored spectral_models.py to merge SpectralEmbedV2Model into SpectralEmbedModel. Both v1 and v2 now use the same unified loader class and share identical encode, batching, and similarity methods, while dispatching to the appropriate featurizer based on the model name. Pushed in the latest commit.
There was a problem hiding this comment.
Won't this make v1 results non-reproducible?
There was a problem hiding this comment.
No, this just adds head to swap between v1 and v2
KennethEnevoldsen
left a comment
There was a problem hiding this comment.
my biggest concern it reproducibility of v1.
| # ============================================================================ | ||
| # MODEL METADATA DEFINITIONS | ||
| # ============================================================================ | ||
|
|
| # ============================================================================ | ||
| # UNIFIED MODEL LOADER (Serves both V1 and V2) | ||
| # ============================================================================ |
| self._pre = f"{seed}:" | ||
|
|
||
| try: | ||
| from nltk.stem import PorterStemmer |
There was a problem hiding this comment.
Is stemming really worth it?
There was a problem hiding this comment.
My experience with it is that is consistently make the model generalize worse, but mostly worked in non-english languages, but would still be surprised if you couldn't do better than stemming.
|
Thanks both. On v1 reproducibility (@KennethEnevoldsen):
On stemming: the v2 weights were trained on the Porter-stemmed, stopword-filtered featurization (spectral_v6), so stemming is part of the model rather than an inference option. Removing it would need retraining. I also removed the banner comments. Re-requesting review from you and @Samoed. |
|
@Samoed FYI: |
|
Yes, I know about that issue, but linux test on lower dependecy is flaky |
Adds
JMullings/spectral-embed-v2-140m(supersedes v1, which is already in MTEB).Model: CPU-only English embedding model. Hashed n-gram featurisation (BLAKE2b, Porter stemming + stopwords, BM25-style term weighting, bucket IDF) followed by a learned linear projection to 2048 dimensions. Model card: https://huggingface.co/JMullings/spectral-embed-v2-140m
Changes
SpectralEmbedV2Model/SpectralFeaturizerand thespectral_embed_v2_140mModelMetasuperseded_byon v1nltkfor stemmingLoader verification: the loader's output matches the original artifact's served embeddings at ~0.994 mean cosine (n=200). A single serving-only weights file (~537 MB) is used.
Training data: TODO (corpus, teacher model, and whether any labelled/evaluation data was used).
Results: to be submitted in embeddings-benchmark/results#789, regenerated against this implementation and revision
6943d55e.Draft until the training-data section is complete and the results are regenerated.