# Apoc NLP error

**URL:** <https://community.neo4j.com/t/apoc-nlp-error/60045>\
**Category:** Neo4j Graph Platform\
**Tags:** migrated\
**Created:** [July 13, 2022, 3:56pm UTC](https://community.neo4j.com/t/apoc-nlp-error/60045 "2022-07-13T15:56:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SushmiT](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@SushmiT](https://community.neo4j.com/u/SushmiT)\
**Post date:** [July 13, 2022, 3:56pm UTC](https://community.neo4j.com/t/apoc-nlp-error/60045/1 "2022-07-13T15:56:31Z")

</div>

Hi, I am trying to create a natural language query to cypher query and retrieve relevant information to the user. I'm using the apoc plugin to achieve that. When I'm trying to iterate over my files and perform nlp actions and tag the categories of the articles.

I'm using the below piece of code:

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:'Text',

   write:true

}) YIELD graph RETURN distinct 'done'",

{batchSize:10})

```

I'm get the following error message:

{  
"Invalid input 'T': expected whitespace, '.', node labels or rel types, '[', '^', '\*', '/', '%', '+', '-', "=~", IN, STARTS, ENDS, CONTAINS, IS, '=', "\<\>", "!=", '\<', '\>', "\<=", "\>=", AND, XOR, OR, ',' or ')' (line 6, column 23 (offset: 292))\r\n" nodeProperty: 'Text',"\r\n ^": 51  
}

batch error:

{  
"total": 51,  
"committed": 0,  
"failed": 51,  
"errors": {  
"org.neo4j.graphdb.QueryExecutionException: Invalid input 'T': expected whitespace, '.', node labels or rel types, '[', '^', '\*', '/', '%', '+', '-', "=~", IN, STARTS, ENDS, CONTAINS, IS, '=', "\<\>", "!=", '\<', '\>', "\<=", "\>=", AND, XOR, OR, ',' or ')' (line 6, column 23 (offset: 292))\r\n" nodeProperty: 'Text',"\r\n ^": 51

Could someone help me with this?  
}  
}

---

<div class="post-metadata">

**Author:** ![ponceortiz](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ponceortiz/32/19816_2.png) [@ponceortiz](https://community.neo4j.com/u/ponceortiz)\
**Post date:** [July 14, 2022, 2:01am UTC](https://community.neo4j.com/t/apoc-nlp-error/60045/2 "2022-07-14T02:01:40Z")

</div>

hi I'm going to sound obvious, but did you run an unit test ? just passing one node , and no comments inside apoc procedure ?  
I've been using Azure Cognitive Services without trouble ...

---

<div class="post-metadata">

**Author:** ![koji](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/koji/32/27564_2.png) [@koji](https://community.neo4j.com/u/koji)\
**Post date:** [July 14, 2022, 1:53am UTC](https://community.neo4j.com/t/apoc-nlp-error/60045/3 "2022-07-14T01:53:26Z")

</div>

Hi [@SushmiT](https://community.neo4j.com/t5/user/viewprofilepage/user-id/14756)

I found the mistake.  
Please add '), to this line.

```auto
key: apoc.static.get('gcp.apiKey // node property that contains the text
key: apoc.static.get('gcp.apiKey'), // node property that contains the text

```
