Skip to content

Fix SemanticSimilarity for sentence-transformers 5.4+ - #1889

Open
omkar-334 wants to merge 1 commit into
evidentlyai:mainfrom
omkar-334:semantic-similarity-sentence-transformers
Open

Fix SemanticSimilarity for sentence-transformers 5.4+#1889
omkar-334 wants to merge 1 commit into
evidentlyai:mainfrom
omkar-334:semantic-similarity-sentence-transformers

Conversation

@omkar-334

Copy link
Copy Markdown

Fixes #1888

SemanticSimilarity was passing pandas Series objects directly to SentenceTransformer.encode. Newer sentence-transformers versions treat a Series as one unsupported input, so the descriptor failed at runtime.

This converts the filled columns to plain lists before encoding and adds a focused regression test for that boundary.

@RK0297

RK0297 commented Jul 25, 2026

Copy link
Copy Markdown

Nice fix! Just a heads up - _context_relevance.py (lines 43 & 45 in semantic_similarity_scoring) also passes a Series directly into model.encode(), so sentence-transformers 5.6.1+ will still fail there.

I have the complementary fix and regression test for _context_relevance.py ready and am opening a small PR to cover that second call site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SemanticSimilarity fails with sentence-transformers > 5.3.0

2 participants