111 points by syntactic 1 year ago flag hide 20 comments
nerd-herder 1 year ago next
This is so cool! I've been waiting for something like this in the browser. How did you manage it with only 20 lines of code?
codemaster 1 year ago next
@nerd-herder, it's all about leveraging the TensorFlow.js library. I have done the hard work converting the model to work with it. And then it's just 20 lines of code to hook it to an input field in the browser.
machine-learning-fan 1 year ago prev next
While it's exciting what you've accomplished, I have some concerns about the inference speed. Could you share some insight on the performance metrics and how you plan on optimizing it?
web-wanderer 1 year ago prev next
I've been working on a similar project. In my opinion, the key is to compress the model without losing much (if any) accuracy. It can make the library more accessible and faster. Great job!
web-wanderer 1 year ago next
@machine-learning-fan, I have some tests that I ran on various machines and mobile devices. I'll share it soon -- just finishing the blog post about it. I agree that inference speed optimization is essential, and it's one of my priorities.
syntax-llama 1 year ago prev next
How's the latency? I'm curious if it can be used for real-time use-cases such as video subtitle translations or even live dictation services.
codemaster 1 year ago next
@Syntax-Llama, the latency is relatively low for machine-learning tasks, but I think there's still some room for improvement. I'm considering using quantization techniques and Web Workers to bring down the latency for real-time use cases. Thank you for raising this question.
intrepid-coder 1 year ago prev next
This is impressive! I'm curious if there are any plans to make this available as a browser extension or a hosted service? It's a great addition to any developer's toolkit.
codemaster 1 year ago next
@Intrepid-coder, there are plans for both. I'm already working on a browser extension, and I plan to deploy this as a web service for users who'd prefer accessing it that way. Stay tuned.
compiled-dreamer 1 year ago prev next
Is the translation service limited to specific languages? Or will it support all languages?
codemaster 1 year ago next
@Compiled-Dreamer, currently, it supports 30 languages bidirectionally. So you can translate from English to Japanese and vice versa, for example. Adding more languages is something I'll consider in the future.
twizzler-dave 1 year ago prev next
Though 20 lines of code is impressive, I believe that accessibility is essential. It should have proper documentation, comments, and more detailed error messages.
codemaster 1 year ago next
@Twizzler-Dave, I totally agree! I plan on writing a thorough guide to help others with the integration. As for error handling, I have taken it into account and have been testing to identify and resolve any issues.
twizzler-dave 1 year ago next
Definitely. I'm marking this to keep track of it and plan to test it out thoroughly. If I come across any issues, I'll let you know. I'm thrilled to see how it holds up in the long run.
bashfulninja 1 year ago next
I'm curious if any other developers have made similar strides with a different approach that we might be able to learn from and collaborate on?
king-coder 1 year ago next
I've tried something similar using the OpenNMT library. But I found the TensorFlow.js implementation to be more efficient and user-friendly. Here's the link if you'd like to take a look: [...]. I'm looking forward to seeing how CodeMaster implemented it!
programmatically-yours 1 year ago prev next
The real test will be when it goes into production. I think that's when we'll see how it handles complex, real-world translations.
bit-runner 1 year ago prev next
The translation isn't always completely accurate, right? How do you handle these situations?
codemaster 1 year ago next
@Bit-Runner, you're right. However, it's worth noting that most popular real-world applications require post-processing to adjust or confirm. For example, Google Translate promptly asks users if it should automatically correct some translations or not, then learns from user-verified translations.
transcendental-tech 1 year ago prev next
This is fantastic work. What were the challenges and lessons learned while building this?