Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Translate non-English inputs only #117

Open
MaikoTan opened this issue Nov 16, 2022 · 7 comments
Open

Feature: Translate non-English inputs only #117

MaikoTan opened this issue Nov 16, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@MaikoTan
Copy link
Member

Scope

NovelAI, NAIFU, Stable Diffusion WebUI (AUTOMATIC1111)

Describe the problem related to the feature request

Currently NovelAI-Bot passes all input into translation service if capable, but translation backends service cost rapidly as there are always extremely long inputs.

Describe the solution you'd like

To add a check that allows non-English text inputs passed into translation service only.

Describe alternatives you've considered

No response

Additional context

No response

@MaikoTan MaikoTan self-assigned this Nov 16, 2022
@shigma
Copy link
Member

shigma commented Nov 16, 2022

One solution I can think of is to first extract non-English words, insert newlines between them, and then replace the original text after translation.

@MaikoTan
Copy link
Member Author

Well, I think it is diffucult to "extract non-English words", some examples:

  • café: coffee store, actually english word, but not captured by regex [a-zA-Z]
  • JK: Japanese-style school uniform, actually Chinglish or Japanglish, not English.
  • kawaii: cute or adorable, Japanese romaji, not English

@shigma
Copy link
Member

shigma commented Nov 16, 2022

According to what you say, can this problem not be solved?

@MaikoTan
Copy link
Member Author

According to what you say, can this problem not be solved?

I am not saying that, just trying to reduce the invoking of translation service as much as possible. Like, you could omit it if there are only English characters in the prompt.

@shigma
Copy link
Member

shigma commented Dec 7, 2022

I think we can provide such a configuration as a bottom-up strategy:

interface TranslatorOptions {
  enabled?: boolean
  ignoreLatin?: boolean
}

@MaikoTan
Copy link
Member Author

MaikoTan commented Dec 7, 2022

interface TranslatorOptions {
  enabled?: boolean
  ignoreLatin?: boolean
}

This option would be provided as the config of NovelAI plugin or any translator plugin?

@shigma
Copy link
Member

shigma commented Dec 7, 2022

NovelAI only - other plugins might not have such complicated situation.

Another approach (for backward compatibility):

interface PromptOptions {
  translator?: boolean
  ignoreLatin?: boolean
}

@MaikoTan MaikoTan added the enhancement New feature or request label Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants