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

Translation API truncated output #2184

Open
devxpy opened this issue Jul 6, 2023 · 0 comments
Open

Translation API truncated output #2184

devxpy opened this issue Jul 6, 2023 · 0 comments

Comments

@devxpy
Copy link

devxpy commented Jul 6, 2023

Environment details

  • OS type and version:
Darwin MacBook-Pro-3.local 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103 arm64
  • Python version: python --version
Python 3.10.5
  • pip version: pip --version
pip 23.1.1 from /Users/dev/.virtualenvs/ddgai-b0692ca2/lib/python3.10/site-packages/pip (python 3.10)
  • google-api-python-client version: pip show google-api-python-client
Name: google-api-python-client
Version: 2.92.0
Summary: Google API Client Library for Python
Home-page: https://github.com/googleapis/google-api-python-client/
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Location: /Users/dev/.virtualenvs/ddgai-b0692ca2/lib/python3.10/site-packages
Requires: google-api-core, google-auth, google-auth-httplib2, httplib2, uritemplate
Required-by: firebase-admin

Steps to reproduce

  1. Run this code
from google.cloud import translate_v2
text = "Hi Sir Mera khet me mircha ke ped me fal gal Kar gir hai to  iske liye  ham kon sa dawa  de please  help me"
translate_client = translate_v2.Client()
result = translate_client.translate(text, target_language="en", source_language="hi")
print(result)
  1. Notice how the translatedText is truncated
{'translatedText': 'hi sir', 'input': 'Hi Sir Mera khet me mircha ke ped me fal gal Kar gir hai to  iske liye  ham kon sa dawa  de please  help me'}
  1. Same thing on translate.google.com works -
image
@devxpy devxpy changed the title API doesn't parse commas in output Translation API truncates gives truncated output Jul 6, 2023
@devxpy devxpy changed the title Translation API truncates gives truncated output Translation API truncated output Jul 6, 2023
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

1 participant