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

GCP NLP procedures error codes #1869

Open
tomasonjo opened this issue Apr 23, 2021 · 1 comment
Open

GCP NLP procedures error codes #1869

tomasonjo opened this issue Apr 23, 2021 · 1 comment

Comments

@tomasonjo
Copy link
Contributor

The main issue is that GCP entities API returns "400" bad request response when a user inputs text of an unsupported language to the GCP entities request.

Example data:

CREATE (b:Article{body:"Kam pa kam veseli popotnik, je rekel prijatelj Janez."})

The text is in Slovenian. If you run it through GCP entities API.

MATCH (a:Article)
CALL apoc.nlp.gcp.entities.graph(a, {
  key: $apiKey,
  nodeProperty: "body",
  writeRelationshipType: "ENTITY"
})
YIELD graph AS g
RETURN g;

The error is:

Failed to invoke procedure apoc.nlp.gcp.entities.graph: Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://language.googleapis.com/v1/documents:analyzeEntities?key=

It seems that this is due to unsupported language. Here is a list of supported languages : https://cloud.google.com/natural-language/docs/languages

This can be very bad for the user experience. We could add a better error response like

"Make sure your text language is supported at https://cloud.google.com/natural-language/docs/languages"

or something. Not sure about failing silently.

p.s. AWS works just fine even though it is not a supported language, but they do have a list of errors https://docs.aws.amazon.com/comprehend/latest/dg/API_DetectEntities.html we could try and catch.

@Nan-sku
Copy link

Nan-sku commented Jun 4, 2022

I get the same error but the language of the body is in English

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants