Inspiration

I created this browser extension because I am learning to read Spanish and I often need to look up the meaning of words online. Existing translation extensions are not ideal because they translate a single word at a time, failing to take into account the context of the rest of the text, and resulting in inaccurate translations. I knew that leveraging a LLM would make it possible to provide accurate translations in context.

What it does

The user can right click on any word on a page and activate the extension using the context menu. The user is presented with a defininition of the word, and they can use a chat interface to ask follow up questions about the word if they wish to supplement their understanding.

The prompt given to the LLM includes the surrounding text of the word which the user right clicked on, in order to get a better explanation.

How we built it

This extension was built using TypeScript, the wxt extension framework, React, and the Mantine component library.

Challenges we ran into

One challenge I encountered was the lack of support for non-English outputs with Gemini Nano. I overcame this in two ways: first, by incorporating Gemini 1.5 Flash as an alternative model which can be selected in my extension's settings page, and secondly by making the functionality less specific to Spanish, instead supporting both English and Spanish as selectable input languages.

Accomplishments that we're proud of

The accomplishment that I am most proud of is that I have been actively using the extension for personal use, outside of development and testing. I find it useful when I am reading text online in Spanish to look up words using my extension and it has helped me to spend more time reading and practicing my Spanish.

What we learned

I learned that my initial idea was valid, and that it works well with powerful models such as Gemini 1.5 Flash. It remains to be seen how effective the Gemini Nano model is for this task, as the initial results have been of mixed quality.

What's next for AI Language Helper

I plan to continue using this extension for my personal use, and submit it to the Chrome Web Store after additional testing and bug fixing.

Built With

Share this project:

Updates