- Notifications
You must be signed in to change notification settings - Fork0
Copy Japanese sentences and automatically generate translations or vocabulary lists using AI
License
alac/clipboard_translate
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Copy Japanese sentences and automatically generate translations or vocabulary lists using AI.Useful with a text hooking utility like Textractor.
Live translations, vocabulary lists.
Ask questions, with the previous lines as context. Uses ctrl+enter as a shortcut.
Additional features:
- Keeps a history of previous lines, so that translations can be more accurate.
- Allows for supplying a 'context' for a description of what you're translating (e.g. "These are twitter posts", or a list of characters in a story).
- Install with
pip install -r requirements.txt
andpython -m unidic download
. - Edit
settings.toml
to enable what you want. - For AI behaviors, you can either set a Google Gemini API key in the settings file.
Or, install Oobabooga's Text-Generation-WebUI, enable the API and configure it in the settings file. - Start the app by entering
python -m jp_vocab_monitor_ui [story_name]
.
You can also configure the program by creating auser.toml
in the root directory. Then, settings will be loaded fromsettings.toml
first, with any overlapping values overridden byuser.toml
.
Per story configuration is also possible by adding a[story_name].toml
in thesettings
folder.
In particular, you can add synopsis to guide the AI with theai_translation_context
key.
I've seen decent translation quality with the following local models:
If you're going toask the AI questions about Japanese, I'd recommend using Google's Gemini Pro via API (Gemini 1.5's accuracy is great; and the free-tier rate limiting should be fine for reading).
For definitions and katakana readings in non-ML mode, we use a modifiedJitendex, which is under theShareAlike license.
For breaking sentences into words, we usefugashi.