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 request] Option to suppress translate logs #799

Open
listvin opened this issue Mar 28, 2024 · 1 comment
Open

[Feature request] Option to suppress translate logs #799

listvin opened this issue Mar 28, 2024 · 1 comment
Assignees

Comments

@listvin
Copy link

listvin commented Mar 28, 2024

What's your feature request? Please describe.
As title says, I need an option to disable excessive logging by MLKit translator.
Currently it spits out every request with input, output and some technical data.
Apart from cluttering, I see it as a security issue, since same behaviour is present in release builds.
R8 tricks for log removal do not affect this, from my understanding because this logging comes from native code.

Mobile environment
Android

Additional context
Log sample for single query

2024-03-28 20:51:06.325 20528-24456 native                  org.example.app        I  I0000 00:00:1711651866.325752   24456 mergeddicttrans.cc:1741] 
                                                                                                    Source language: iw, target language: en
                                                                                                    
                                                                                                    Full translation: Laid a fingerprint to continue
                                                                                                    Translate Instance: 
                                                                                                    Query (raw): יש להניח טביעת אצבע להמשך
                                                                                                    Query (after preprocess): יש להניח טביעת אצבע להמשך
                                                                                                    Query ids (after tokenizer): 85 126 3122 172 173 303 2336 353 126 1988 2
                                                                                                    Translation ids: 35 1671 11 122 2356 444 679 7 2229 2
                                                                                                    Translation (after detokenizer): Laid a fingerprint to continue
                                                                                                    Alignment probability:
                                                                                                    	Laid	a	fingerprint	to	continue
                                                                                                    יש	0.123529	0.0627451	0.00294118	0.141176	0.00784314
                                                                                                    להניח	0.435294	0.0901961	0.00882353	0.0470588	0.0156863
                                                                                                    טביעת	0.0568627	0.25098	0.495098	0.0745098	0.0117647
                                                                                                    אצבע	0.160784	0.341176	0.398039	0.0156863	0.00784314
                                                                                                    להמשך	0.135294	0.117647	0.0578431	0.678431	0.862745
                                                                                                    Translation (before postprocess): Laid a fingerprint to continue

@listvin
Copy link
Author

listvin commented Apr 20, 2024

Hello, @zhouyiself !
Any thoughts?

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
@zhouyiself @listvin and others