'Neoj4 GCP error: "The requested URL /v1/documents:classifyText?key=apiKey was not found on this server"

I am trying to figure out how Neoj4 Desktop can be used to handel NLP usgin this blog. Everything was ok until the text classification moment:

CALL apoc.periodic.iterate("
// get all articles
   MATCH (node:Article) RETURN node
  ","
   // classify each article
   CALL apoc.nlp.gcp.classify.graph(node, {
       // we retrieve gcp api key from static value storage
       key: apoc.static.get('gcp.apiKey'),
       // node property that contains the text
       nodeProperty: 'content',
       write:true
    }) YIELD graph RETURN distinct 'done'",
    {batchSize:10})

Instead of returning categories, it returns "The requested URL /v1/documents:classifyText?key=apiKey was not found on this server" error

Maybe it is something with GCP credentials, but I have done everything as suggested.



Solution 1:[1]

Thanks for reading my blog post! :)

Please try the following command:

RETURN apoc.static.get('gcp.apiKey')

Does it return anything? It should return your google API key. If it doesn't work you can always just try to copy your API key into the query. On the other hand, if apoc.static.get works as intended, maybe try to Enable your Natural Language API in the google console. That could be one issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tomaž Bratanič