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 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:
The text is in Slovenian. If you run it through GCP entities API.
The error is:
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.