Add embedding similarity calculations - #993
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #993 +/- ##
=============================================
- Coverage 75.37% 74.24% -1.14%
- Complexity 3357 3447 +90
=============================================
Files 138 140 +2
Lines 12976 13315 +339
=============================================
+ Hits 9781 9886 +105
- Misses 3195 3429 +234
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What?
Partially closes #962
Adds a
Vector_Mathclass with various public methods that can be used to run similarity calculations against two vector embeddings. Also adds aVector_Rankerclass to score vectors against one another.Why?
#892 and #975 brought in embedding code from the PHP AI Client. #976 brought in the data layer to store embeddings. This PR is one of the next steps in the overall embedding goal, allowing us to run comparisons from one vector to another.
How?
Vector_Mathclass with various public methods that can be used to run similarity calculations against two vector embeddingsVector_Rankerclass to score vectors against one anotherUse of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Fable 5.1, Opus 5
Used for: Planning approach and executing on that. Review of approach and final review and testing by me
Testing Instructions
Easiest way to test is the custom WP-CLI command added as part of this PR:
Changelog Entry