nlpcloud / nlpcloud-php

NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, paraphrasing, intent classification, product description and ad generation, chatbot, grammar and spelling correction, keywords and keyphrases extraction, text generation, image generation, code generation, and much more...

Home Page:https://nlpcloud.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal error: Uncaught Exception: 401:

Vikasitha444 opened this issue · comments

Notice: Trying to get property 'detail' of non-object in C:\xampp\htdocs\PHP Tutorials\NLU model\vendor\nlpcloud\nlpcloud-client\src\NLPCloud.php on line 169

Fatal error: Uncaught Exception: 401: in C:\xampp\htdocs\PHP Tutorials\NLU model\vendor\nlpcloud\nlpcloud-client\src\NLPCloud.php:169 Stack trace: #0 C:\xampp\htdocs\PHP Tutorials\NLU model\grammar.php(8): NLPCloud\NLPCloud->summarization('One month after...') #1 {main} thrown in C:\xampp\htdocs\PHP Tutorials\NLU model\vendor\nlpcloud\nlpcloud-client\src\NLPCloud.php on line 169

Hello @Vikasitha444 it seems that there is an authentication issue with your request.
Did you properly retrieve your API token on NLP Cloud?
Maybe you can share your piece of code here?

Fatal error: Uncaught Error: Call to undefined function gsCorrection() in C:\xampp\htdocs\PHP Tutorials\tg-bot\NLP Model\grammar.php:22 Stack trace: #0 {main} thrown in C:\xampp\htdocs\PHP Tutorials\tg-bot\NLP Model\grammar.php on line 22

<?php

require 'vendor/autoload.php';

use NLPCloud\NLPCloud;

$client = new \NLPCloud\NLPCloud('bart-large-cnn','<my_key>');
$client.gsCorrection("<Your block of text>");

Thanks.

Grammar correction is not compatible with Bart Large CNN.
You should either use GPT-J, Fast GPT-J, or Finetuned GPT-NeoX 20B.
Here's an example using GPT-J (you need to select the pay-as-you-go plan for your tests):

<?php

require 'vendor/autoload.php';

use NLPCloud\NLPCloud;

$client = new \NLPCloud\NLPCloud('gpt-j','<my_key>',True);
$client.gsCorrection("<Your block of text>");

Closing as inactive.