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

API - detected_source_language giving wrong or insuffisant informations #23

Closed
Steelwix opened this issue Jul 1, 2024 · 3 comments
Closed

Comments

@Steelwix
Copy link

Steelwix commented Jul 1, 2024

Good morning,

I'm receiving words from a language I don't know in my PHP application(it could be French or English), and I was surprised to see an english word in my french translation table.

It turns out that on this query, Deepl detects that the original language of "saffron" is French :

{
    "text":["saffron"],
    "target_lang": "EN"
}

Returns :

{
    "translations": [
        {
            "detected_source_language": "FR",
            "text": "saffron"
        }
    ]
}

The source_language should be "EN"

I have another conflict with the word "verre" (glass in french), where Deepl detects a source_language = "NL", even though it is also a french word.

Is there a way to refine these searches, considering that I don't necessarily know if my source_language is FR or EN, but for example by excluding languages ​​that I don't want, like NL?

Or is there any way to to ensure that an english word is not detected as french?

Sincerely,

Mael

@JanEbbing JanEbbing transferred this issue from DeepLcom/deepl-php Jul 1, 2024
@JanEbbing
Copy link
Member

Hi, we don't have features to customize/help language detection at the moment unfortunately. There was some discussion around this and what the interface could look like in our discord community (you need to be in the community to see the link). In general, source language detection works much better for longer input texts. Are your inputs always single words? Maybe looking up the words in a dictionary is a better way for single-word translation. (though of course many words are valid in multiple languages, which you would need to distinguish somehow; and you would need to be able to handle typos/misspellings).

@Steelwix
Copy link
Author

Steelwix commented Jul 1, 2024

Thanks for your quick response.
Yes, sadly I have only single words comming in so I'll check the idea about the dictionary.

@Steelwix Steelwix closed this as completed Jul 1, 2024
@cyberluke
Copy link

Amateur style, Pro subscription and on multi-lang how can you detect input language, guys? So stupid and annoying, canceling subscription and going somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants