Eevo console
Contents
How-to guides

Content filtering with Eevo

The combination of flexibility and efficiency in terms of speed and cost makes System One models like Eevo excellent for filtering content. Below is an example of using Eevo to check a product review against a review policy:

import os

import requests

REVIEW = """Terrible blender. It broke after two weeks and the seller ignored my emails. His number is +44 7700 900123, call him and tell him what you think."""

QUESTIONS = {
    "action": {
        "type": "choice",
        "instructions": "What should happen to this review under our review policy?",
        "criteria": {
            "publish": "Publish: an honest opinion about the product or the seller, however negative",
            "review": "Hold for a moderator: it may break the policy, and a person should decide",
            "reject": "Reject: it clearly breaks the policy (threats, hate, spam, or someone’s personal details)",
        },
    },
    "personal_details": {
        "type": "noul",
        "instructions": "The review contains a phone number or an email address.",
    },
    "harassment": {
        "type": "noul",
        "instructions": "The review threatens or harasses a named person.",
    },
}

response = requests.post(
    "https://eevo.io/api/v1/systemone",
    headers={"Authorization": f"Bearer {os.environ['EEVO_API_KEY']}"},
    json={"model": "eevo-1", "state": f"Product review: {REVIEW}", "questions": QUESTIONS},
)
response.raise_for_status()
print(response.json()["answers"])

In the snippet, there is a choice question with the actions the policy allows, each described by what belongs there, and specific questions for the rules a moderator should see reported on their own. The criteria state what the policy allows as well as what it does not: "however negative" keeps honest criticism from being held.

An example response is below:

JSON
{
  "action": {
    "type": "choice",
    "choice": "reject",
    "confidence": 0.8866,
    "probabilities": {
      "publish": 0.037,
      "review": 0.0764,
      "reject": 0.8866
    }
  },
  "personal_details": {
    "type": "noul",
    "noul": 0.9663
  },
  "harassment": {
    "type": "noul",
    "noul": 0.8133
  }
}

As usual, the decision model provides probabilities reflecting its confidence in each answer. The probabilities allow for setting thresholds, so that a review is published or rejected automatically only when the answer is confident, and the rest go to a moderator with the specific answers as the reasons.