Unprofane

Raw HTTP

Change the host. Everything else is the request you already send.

1. The request

The path, the body and the key parameter are Google’s. A bearer header works too.

curl -X POST "https://api.unprofane.com/v1alpha1/comments:analyze?key=up_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "comment": {"text": "you are a clown"},
    "requestedAttributes": {"TOXICITY": {}, "INSULT": {}},
    "languages": ["en"],
    "doNotStore": true
  }'

2. The response

attributeScores with a summaryScore and spanScores per attribute, languages, detectedLanguages. Errors use Google’s envelope: code, message, status.

{
  "attributeScores": {
    "TOXICITY": {
      "spanScores": [{ "begin": 0, "end": 15, "score": { "value": 0.71, "type": "PROBABILITY" } }],
      "summaryScore": { "value": 0.71, "type": "PROBABILITY" }
    },
    "INSULT": { "summaryScore": { "value": 0.78, "type": "PROBABILITY" }, "spanScores": [] }
  },
  "languages": ["en"],
  "detectedLanguages": ["en"]
}

3. What to expect on the scale

The scores are the engine’s own until the Civil Comments calibration ships. Use the replay tool with a CSV of your texts and their old scores to map your thresholds.

Then

Map your thresholds with the replay tool, and read what is different. The other guides are on the migration hub.