Open AmitMY opened 2 years ago
Hi, welcome!
Have you taken a look at https://github.com/browsermt/bergamot-translator/pull/437 ?
@jelmervdl is the javascript expert, I defer to him but it does look much simpler.
Thanks @kpu I was not aware of that PR, would have saved me some time :)
I probably did not put as much thought into this as @jelmervdi did, and thus may have not included some extra features / some additional code cleaning, as my goal was having something published, and usable right away.
Running the
test_page
example in this repository left me wowed, but also with a little bad taste, as for the complexity of how much code one needs to write/copy in order to use it. Additionally, all paths in that example are relative, requiring every user to adjust the worker code to their directory structure.I replicated that example fully here - https://github.com/sign/browsermt/tree/main/example/src And wrote an npm module to work with bergamot models
From your app, usage becomes extremely simple: