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

RomanizeText API is broken #11866

Open
rdp1414 opened this issue May 24, 2023 · 3 comments
Open

RomanizeText API is broken #11866

rdp1414 opened this issue May 24, 2023 · 3 comments
Assignees
Labels
api: translate Issues related to the Cloud Translation API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@rdp1414
Copy link

rdp1414 commented May 24, 2023

We need the Romanization feature badly. Can someone please help? We want to transliterate (not translate) from Hindi (Devanagari script) language to English (Roman script) language.

Input
romanize_text('अंतिम लक्ष्य क्या है')

Expected Output
'antim lakshya kya hai'

Environment details

  • OS type and version: Windows 11
  • Python version: 3.9.11
  • pip version: 23.1.2
  • google-cloud-translate version: 3.11.1

Things I tried

  1. Complained at Google APIs groups.
  2. Looked up in the Google's API reference of romanizeText. I saw that the right-hand side API Explorer is broken. Whereas, if you select any other method from the left-hand side - its API Explorer works correctly.
  3. Looked into the source code file but couldn't find any API named romanize_text.

Steps to reproduce

  1. As per the Google Romanize text docs, I wrote the following Python code to transliterate from some language script to Roman script.
  2. The below code with minor replacements works correctly for translate_text API.

Code example

# Authenticate using credentials.
import os
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "translate.json"

PROJECT_ID = "project-id"
LOCATION = "global"

# Imports the Google Cloud Translation library
from google.cloud import translate_v3

# Transliteration.
def romanize_text(text, src_lang="hi", tgt_lang="en"):

    client = translate_v3.TranslationServiceClient()
    parent = f"projects/{PROJECT_ID}/locations/{LOCATION}"

    response = client.romanize_text(
        request={
            "parent": parent,
            "contents": [text],
            "source_language_code": src_lang,
            "target_language_code": tgt_lang,
        }
    )

    # Display the romanized for each input text provided
    for romanization in response.romanizations:
        print(f"Romanized text: {romanization.romanized_text}")

romanize_text('अंतिम लक्ष्य क्या है')

Stack trace

AttributeError: 'TranslationServiceClient' object has no attribute 'romanize_text'

We need the Romanization feature urgently. Can someone please help?

@product-auto-label product-auto-label bot added the api: translate Issues related to the Cloud Translation API. label May 24, 2023
@rdp1414
Copy link
Author

rdp1414 commented May 27, 2023

Hello team,

Is it possible to either give some work-around or at least give an ETA of this?

@parthea parthea self-assigned this Oct 20, 2023
@parthea
Copy link
Contributor

parthea commented Oct 21, 2023

I'm going to transfer this issue to google-cloud-python as we're planning to move the code for google-cloud-translate there in the next 1-2 weeks

@parthea parthea transferred this issue from googleapis/python-translate Oct 21, 2023
@vchudnov-g
Copy link
Contributor

Thanks for filing this issue. This is a Translate API feature request, not an issue that pertains directly to the Python client libraries. We'll route your request to the API team internally. If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

@vchudnov-g vchudnov-g added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: translate Issues related to the Cloud Translation API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants