dcramer / peated

https://peated.com
Apache License 2.0
64 stars 13 forks source link

Add embeddings for bottle aliases #187

Closed dcramer closed 4 months ago

codecov[bot] commented 4 months ago

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

:x: Failed Test Results:

Completed 289 tests with 2 failed, 287 passed and 0 skipped.

View the full list of failed tests ## src/trpc/routes/reviewCreate.test.ts - **Class name:** src/trpc/routes/reviewCreate.test.ts
**Test name:** new review with existing bottle

TRPCError: there is no unique or exclusion constraint matching the ON CONFLICT specification
❯ ../../node_modules/.pnpm/pg@8.12..../pg/lib/client.js:526:17
❯ .../trpc/routes/reviewCreate.ts:69:9
❯ NodePgSession.transaction ../../node_modules/.pnpm/drizzle-orm@0.32.0_@opentelemetry+api@1.9.0_@types+pg@8.11.6_pg@8.12.0_react@18.3..../src/node-postgres/session.ts:155:19
❯ .../trpc/routes/reviewCreate.ts:46:20
❯ resolveMiddleware ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
- **Class name:** src/trpc/routes/reviewCreate.test.ts
**Test name:** new review with new bottle matching entity

TRPCError: there is no unique or exclusion constraint matching the ON CONFLICT specification
❯ ../../node_modules/.pnpm/pg@8.12..../pg/lib/client.js:526:17
❯ .../trpc/routes/reviewCreate.ts:69:9
❯ NodePgSession.transaction ../../node_modules/.pnpm/drizzle-orm@0.32.0_@opentelemetry+api@1.9.0_@types+pg@8.11.6_pg@8.12.0_react@18.3..../src/node-postgres/session.ts:155:19
❯ .../trpc/routes/reviewCreate.ts:46:20
❯ resolveMiddleware ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/.pnpm/@trpc+server@11.0.0-rc.334/node_modules/@.../dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
dcramer commented 4 months ago

Dont think this is ultimately going to be that useful. It could be a lazy way out for a moderation queue, but going to keep this as a draft until I validate more rule-based approaches.

dcramer commented 4 months ago

Refs #55

dcramer commented 4 months ago

Deciding this is likely still going to be useful for the manual matching - basically we can build a queue of actions needed, use the embeddings to find the 'most likely match', and make it much faster for a human to review the queue. We'll then add a new BottleAlias for every match, and slowly widdle down issues. Its not the most efficient way, but it will certainly be a correct way.

Likely will continue then with improving BottleFinder to have additional rule-based approaches similar to the matches examples included.