Skip to content

kunz398/Laravel_ML-TensorFlow-Api-for-Toxic-Text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HOW TO USE

  1. Firstly you would need to install Tensorflowjs toxic Modal
    npm install @tensorflow/tfjs @tensorflow-models/toxicity
  1. Import the Modal to : resources /js/bootstrap.js
    window.toxicity = require('@tensorflow-models/toxicity');
  1. The ValidationController.php contains the Code for making the prediction on the Toxicity Modal

  2. The Demo.php contains a front end view as shown below

enter image description here

  1. api.php contains the api route

  2. how to make the API Call:

       require_once get_template_directory() . "/framework/Curl.php";  
      
      $url = 'http://bati.local/api/invokeML';  
      
      $params = array(  
      'from'=>get_option('siteurl'),  
      'word' => ' You Suck',  
      );  
      
      $output = Curl::httpPost($url, "POST", $params);  
      
    var_dump($output);

enter image description here

In-order to learn how to make API calls you can look at my ApiCall Repo:: Api Call PHP

About

Toxicity Tensor flow Modal with JS and Laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published