do-me / SemanticFinder

SemanticFinder - frontend-only live semantic search with transformers.js
https://do-me.github.io/SemanticFinder/
MIT License
226 stars 16 forks source link

Use semantic-js package #22

Closed lizozom closed 1 year ago

lizozom commented 1 year ago

I extracted a semantic search package This is an implementation of the demo using that package.

Note that the progress bar is gone, as the worker returns the final list.

do-me commented 1 year ago

Thanks for the PR! A few points:

Note that the progress bar is gone, as the worker returns the final list.

semantic.js:23 Uncaught (in promise) TypeError: tokenizer is not a function
    at getTokens (semantic.js:23:18)
    at splitByTokens (utils.js:43:82)
    at splitText (utils.js:25:26)
    at semanticHighlight (index.js:199:80)
    at onSubmit (index.js:80:15)
    at HTMLButtonElement.onclick ((index):49:110)
lizozom commented 1 year ago

No problem, I'm pretty sure I could stream the results from the package, instead of returning them in one piece.

Regardless, I think we should decide whether we want to use a package or not (I will gladly make you guys co-admins @do-me @VarunNSrivastava ), otherwise we're going to get a bunch of conflicts.

lizozom commented 1 year ago

And the table is @VarunNSrivastava 's doing!

do-me commented 1 year ago

No problem, I'm pretty sure I could stream the results from the package, instead of returning them in one piece.

That would be really nice!

As we have two PR's open at the moment and @VarunNSrivastava 's #23 is still building on the current implementation, I'd go ahead and merge his first. As soon as we have the progress bar logic in semantic-js, I guess we'd be ready to merge semantic-js and SemanticFinder (or split, depending on the perspective ;) ). Hence, for the moment, I'll just leave this PR open.

varunneal commented 1 year ago

I used Xenova's demo for reference on how to do progress bars with WebWorkers. Once my PR is merged hopefully the progress bars look a little cleaner and we can implement this in semantic-js.

lizozom commented 1 year ago

Replaced with https://github.com/do-me/SemanticFinder/pull/26