# NLP API

Natural language processing (NLP) API digunakan untuk menganalisis dan mengklasifikasikan teks jauh lebih efisien dan akurat daripada yang bisa dilakukan manusia.

### **Get Similarity Result by Sentence**

| Method     | POST                                                                                                                                                                                                                                                                               |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                                                                                                                   |
| URL        | http\://\[server]/dolphin/apiv1/graph/nlp/similarity                                                                                                                                                                                                                               |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                                                                                                           |
| Body       | <p>{<br>“lang”: “Indonesia”,<br>“sentence1”: “cara mendaftarkan akun”,<br>“sentence2”: “cara mendaftarkan account”,<br>“nouns1”: \[<br>   “akun”<br>],<br>“nouns2”: \[<br>   “account”<br>],<br>“verbs1”: \[<br>   “akun”<br>],<br>“primaryTerms”: \[<br>   “string”<br>]<br>}</p> |
| Status     | 200                                                                                                                                                                                                                                                                                |
| Response   | <p>{<br>   “status”: “success”,<br>   “data”: 0.13979776251968268,<br>   “hasMore”: false,<br>   “nextIndex”: 0,<br>   “prevIndex”: 0,<br>   “totalResults”: 0<br>}</p>                                                                                                            |

### **Get Noun Ambiguity Score**

| Method     | POST                                                                                                                                                                                                                                                                                   |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                                                                                                                       |
| URL        | http\://\[server]/dolphin/apiv1/graph/nlp/wordNeighborList                                                                                                                                                                                                                             |
| Header     | Authorization **:** Bearer \[generatedToken]                                                                                                                                                                                                                                           |
| Body       | <p>{<br>“lang”: “Indonesia”,<br>“sentence1”: “Dia datang kemari memberi tahu”,<br>“sentence2”: “”,<br>“nouns1”: \[<br>   “memberi tahu”<br>],<br>“nouns2”: \[<br>   “memberi informasi”<br>],<br>“verbs1”: \[<br>   “memberi”<br>],<br>“primaryTerms”: \[<br>   “string”<br>]<br>}</p> |
| Status     | 200                                                                                                                                                                                                                                                                                    |
| Response   | <p>{<br>   “status”: “success”,<br>   “data”: 0,<br>   “hasMore”: false,<br>   “nextIndex”: 0,<br>   “prevIndex”: 0,<br>   “totalResults”: 0<br>}</p>                                                                                                                                  |

### **Get Word Neighbor Result by Word**

| Method     | POST                                                                                                                                                                    |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                        |
| URL        | http\://\[server]/dolphin/apiv1/graph/nlp/wordNeighbor                                                                                                                  |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                |
| Body       | <p>{<br>“lang”: “Indonesia”,<br>“word1”: “adm”,<br>“word2s”: \[<br>  “admin”<br>]<br>}</p>                                                                              |
| Status     | 200                                                                                                                                                                     |
| Response   | <p>{<br>   “status”: “success”,<br>   “data”: 0.27198508381843567,<br>   “hasMore”: false,<br>   “nextIndex”: 0,<br>   “prevIndex”: 0,<br>   “totalResults”: 0<br>}</p> |

### **Get Word Neighbor List**

| Method     | POST                                                                                                                                                                                         |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                             |
| URL        | http\://\[server]/dolphin/apiv1/graph/nlp/wordNeighborList                                                                                                                                   |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                     |
| Body       | <p>{<br>   “lang”: “Indonesia”,<br>   “word1”: “atm terdekat”,<br>   “word2s”: \[<br>      “atm dekat sini”<br>]<br>}</p>                                                                    |
| Status     | 200                                                                                                                                                                                          |
| Response   | <p>{<br>“status”: “success”,<br>“data”: \[<br>   “sambungkan”,<br>   “customer”,<br>   “care”<br>],<br>“hasMore”: false,<br>“nextIndex”: 0,<br>“prevIndex”: 0,<br>“totalResults”: 0<br>}</p> |

### **Get Sensitive Words**

| Method     | POST                                                                                                                                                                                         |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                             |
| URL        | http\://\[server]/dolphin/apiv1/graph/nlp/word/sensitive                                                                                                                                     |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                     |
| Body       | <p>{<br>   “sentence”: “sambungkan ke cs”<br>}</p>                                                                                                                                           |
| Status     | 200                                                                                                                                                                                          |
| Response   | <p>{<br>“status”: “success”,<br>“data”: \[<br>   “sambungkan”,<br>   “customer”,<br>   “care”<br>],<br>“hasMore”: false,<br>“nextIndex”: 0,<br>“prevIndex”: 0,<br>“totalResults”: 0<br>}</p> |

### **Get Classification Active Module**

| Method     | GET                                                                                                                                                                                                                   |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                                                      |
| URL        | http\://\[server]/dolphin/apiv1/graph/nlp/classify/active                                                                                                                                                             |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                                              |
| Body       |                                                                                                                                                                                                                       |
| Status     | 200                                                                                                                                                                                                                   |
| Response   | <p>{<br>“status”: “success”,<br>“data”: \[<br>   “Gabriel – First Media”,<br>   “Error Message Code”,<br>   “Services”<br>],<br>“hasMore”: false,<br>“nextIndex”: 0,<br>“prevIndex”: 0,<br>“totalResults”: 0<br>}</p> |

### **Get classification value**

| Method     | POST                                                                                                                                                                                                                       |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                                                           |
| URL        | http\://\[server]/dolphin/apiv1/graph/nlp/classify/module                                                                                                                                                                  |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                                                   |
| Body       | <p>{<br>   “module”: “Services”,<br>   “message”: “Hallo”<br>}</p>                                                                                                                                                         |
| Status     | 200                                                                                                                                                                                                                        |
| Response   | <p>{<br>“status”: “success”,<br>“data”: {<br>   “module”: “Services”,<br>   “message”: “Hallo”,<br>   “category”: “default”<br>},<br>“hasMore”: false,<br>“nextIndex”: 0,<br>“prevIndex”: 0,<br>“totalResults”: 0<br>}</p> |

### **Get classification value**

| Method     | POST                                                                                                                                                                                                                                                                                                                        |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                                                                                                                                                            |
| URL        | http\://\[server]/dolphin/apiv1/graph/nlp/classify/enabled                                                                                                                                                                                                                                                                  |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                                                                                                                                                    |
| Body       | <p>{<br>   “message”: “Hallo”,<br>   “start”: 1,<br>   “count”: 10<br>}</p>                                                                                                                                                                                                                                                 |
| Status     | 200                                                                                                                                                                                                                                                                                                                         |
| Response   | <p>{<br>“status”: “success”,<br>“data”: {<br>   “message”: “Hallo”,<br>   “categories”: \[<br>     “default”,<br>     “default”<br>     ],<br>   “modules”: \[<br>     “Error Message Code”,<br>     “Services”<br>     ]<br>   },<br>“hasMore”: false,<br>“nextIndex”: 0,<br>“prevIndex”: 0,<br>“totalResults”: 0<br>}</p> |
