google / ad_language_monitor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ad Language Monitor

This is not an officially supported Google product. It is a reference implementation.

Overview

A Cloud Function that uses Retext.js to monitor the inclusive language of ad copy.

Deploy

Run the command:

gcloud functions deploy AdLanguageMonitor \
    --runtime nodejs14 \
    --memory 1GB \
    --timeout 540s \
    --trigger-http

Testing

Install dependencies:

yarn

Run the tests:

yarn test

Development

Run the development environment:

yarn start

Send a payload to the development function:

curl -X POST http://localhost:8080/ -H "Content-Type:application/json"  -d '{ "text": "He’s pretty set on beating your butt for sheriff." }'

Note: You can use either the HTTP query string or the JSON body to generate a response.

References

About

License:Apache License 2.0


Languages

Language:JavaScript 100.0%