Naughty Node is a severless implementation of Tesnsorflow.js's prebuilt toxicity model for single queries.
The usage of Naughty Node is quite straight forward, all requests should be sent as GET
s with all variables provided as query parameters.
The following query parameters are used in Naughty Node:
term
— The term is the word/phrase/text that you want Naughty Node to evaluate.kgKey
— The kgKey is used as an authentication key, can you learn more about the usage and implementation here.
The uses cases for this are genuinely limited by your imagination.
At Kogneta, a few cases for Naughty Node include:
- Evaluating page content and anchors to identify spammy links
- Scanning UGC for content that may need to be removed
- Analyzing customer reviews to identify offensive or explicit ones
... are you using Naught Node in a unique way? Let us know and we'll feature you :)
In order for Naughty Node to work, the following environment variable(s) need to be configured and used:
In order to prevent any Joe/Jane Schmo from using your Cloud Function, Naughty Node uses an internal environment key that all requests are checked against. The variable name is called kgKey
.
On the request side the kgKey
is evaluated as a query parameter in all requests.
Since Tensorflow.js is quite picky about the hardware and Node.Js versions it is deployed on, I've found that the following Google Cloud Function settings have worked best:
Item | Configuration Value |
---|---|
Memory | 8 GiB |
Runtime | Node.js 12 |
Timeout | 120 seconds |