Building Web Apps With Google Cloud AI Platform Language Detection API
Building a web app with Google Cloud's Language Detection API: detect top 3 languages in text, integrate with `@google-cloud/ai-platform` package, and destroy detector on service destruction.
In this blog post, I describe how to build a simple language detection application locally using Chrome's Built-In Language Detection API and Angular. First, the Angular application calls the API to create a language detector and use it to detect the language code of the inputted text. Then, it invokes a helper function to map the language code into the language name. The cost is zero since the application does not need any vendor's LLM. This is the happy path when users use Chrome Dev or Chrome Canary. If users use non-Chrome or old Chrome browsers, a fallback implementation should exist...