Published on Dec 7, 2023Olivia WilliamsRead time: 11m4.3K viewer
Profanity Detection Across Languages: What an English Word List Misses

Profanity Detection Across Languages: What an English Word List Misses

A marketplace with users in six languages usually starts with one filter: an English word list, a handful of blocked phrases, and the assumption that the rest of the traffic behaves. Then the reports come in from Arabic, Hindi and Tagalog threads the filter never touched, while an English review gets held for a word that was not an insult to anyone.

Profanity detection is the piece of moderation a platform can automate. Language coverage decides whether that automation helps or just hands the work to a reviewer who does not read the language either.

"Translation-based pipelines consistently outperform out-of-distribution classifiers in 81.3% of cases (13 of 16 languages), with translation benefits strongly correlated with both the resource level of the target language and the quality of the machine translation system." The same study found classical classifiers beating large language model judges, a gap that widened for low-resource languages, where translate-classify methods won in 6 of 7 cases. Translate, then Detect: Leveraging Machine Translation for Cross-Lingual Toxicity Classification, arXiv, September 2025.

The cost of a filter that only reads English

A one-language filter fails quietly. Nothing crashes, no error appears in the logs, and the queue fills with the cases that got through. The damage lands in two places: users leave a community that tolerates abuse, and moderators spend their day on the wrong messages. A trust and safety team that cannot explain a decision to a regulator or an advertiser is the quieter loss.

There is a second cost that gets less attention. Over-flagging pushes good users into verification loops and appeals. A filter tuned on one language tends to flag harmless words in another, because a short word in Portuguese or a name in Yoruba can look like an English profanity once the characters are lowercased and compared against a list.

Both failures come from the same design: matching strings instead of scoring meaning in the language the sentence was written in.

What profanity detection returns

Greip returns two values for a piece of text: a risk_level of low, medium or high, and a recommendation of accept, review or reject derived from it. There is also execution_ms so you can see the latency your queue adds per message.

The classification works on severity. Risky phrases and words rank first, then medium-risk terms, then low-risk ones, and the highest match sets the level. Clean text comes back as low. The endpoint is POST /score/text on API v2, and it takes the key in the Authorization header only.

curl --request POST \
  --url https://v2.greipapi.com/score/text \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "text": "This is a sample text without profanity!",
    "source": "marketplace-review"
  }'

The response:

{
  "success": true,
  "data": {
    "risk_level": "low",
    "recommendation": "accept"
  },
  "execution_ms": 120
}

The source field is yours to label, so a single key can separate reviews from chat messages in your own analytics and in support cases.

Risk level instead of a word count

API v1 answered with a word count and a numeric risk score. API v2 dropped the word-list fields and answers with the level and the action. That change matters for multilingual work: a count tells you how many list entries matched, which is meaningless when the list was written for one language, while a level and a recommendation can be mapped onto your own policy for every language you run.

If an integration still reads totalBadWords or a numeric riskScore, it is on the deprecated path. The v2 profanity endpoint documentation lists the current fields, and the endpoint is available on Standard and above.

Where translation breaks the score

The obvious shortcut is to translate every message into English and score it there. The study above says that shortcut works more often than the alternative, in 13 of 16 languages, and then explains why it still is not free.

Machine translation is built to carry meaning, not intent. A dialect insult can come out as a neutral description. Sarcasm between two friends reads as a threat in the target language. A slur that exists only in one region has no equivalent, so the translator picks the nearest word and moves on, sometimes into a stronger English term than the original.

Resource level decides how much of this you get. Languages with large parallel corpora survive the round trip. Languages with little training data lose the parts of a sentence that carry the abuse, which is exactly the case where the study found translation gains to be weakest and where classifier choice mattered most.

None of this makes translation useless. It makes translation a step whose error you have to design around, not a preprocessing call you can forget.

Code-mixed text is the normal case

Real messages rarely stay in one language. Hinglish mixes Hindi and English in the same sentence, Arabizi writes Arabic in Latin letters, and a Filipino user might switch three times in one review. A list-based filter sees Latin characters and either misses the abuse entirely or flags an innocent word that happens to appear in the middle.

This is where a scoring model earns its place. It reads the whole string, so a sentence that is half English and half something else gets one judgement instead of two half-failed matches. It also means your sampling plan has to include code-mixed messages, because an average accuracy number from clean, single-language test data will not describe your traffic.

Scripts, digits and characters that fool a list

Some failures are mechanical, and they are worth testing before you blame the model.

Arabic written in Latin letters uses digits for letters that have no equivalent, so a word can contain 3, 7 or 9 in the middle of a profanity and still be readable to a person. Turkish has a dotless i that changes case folding. German writes ß where a list holds ss. Greek has a final sigma that differs by position in the word. Any of these can turn a match into a miss after a naive lowercase and compare.

Unicode normalization, case folding and script detection belong in your own pipeline if you are doing anything with the text before scoring. Send the original string to the detector, and keep a copy of the raw text for the review queue so a moderator sees what the user actually typed.

Questions to ask about language coverage

Vendors answer coverage questions differently when the questions are specific. These are the ones that change the answer you get.

Which languages are handled natively

Natively handled means the model was trained on text in that language and script, not on translations of it. If the answer is a number of languages, ask for the list and pick the three you actually need.

How new slang gets added

Every language adds terms faster than any vendor can retrain. Ask whether your team can supply examples, whether a custom term list exists, and how long a change takes to reach production.

What a response looks like for a message you cannot read

Send ten real messages per language, including two that should pass and two that should not, and compare the level and recommendation with what your own speakers expect. This takes an afternoon and tells you more than a coverage table.

Whether thresholds can differ per language

One global cut-off assumes every language carries the same risk at the same level. It does not, and some trained models are more cautious in some languages than others. If you cannot set a threshold per language, you will be choosing between over-flagging one market and under-flagging another.

Setting thresholds per language

Start with what happens to each level rather than with the level itself. A workable default for a platform with limited reviewer capacity looks like this:

  • reject for high in every language, with the message held and the user shown a policy reason.
  • review for medium in the languages your reviewers speak, and a lower auto-block bar where no reviewer is available.
  • accept for low, still logged, because a sample of accepted messages is the only way to find what the model misses.

Then measure. Track the share of accepted messages that later get reported, per language. That number tells you whether the threshold for that language is set too loose, which a global CTR or accuracy figure will hide.

Reviewing a flag you cannot read

A moderation queue needs a person who reads the language. Until you have one, translation is a triage tool, not a decision tool: use it to sort which queue an item goes to, and keep the original text next to it.

Two rules keep this honest. Never auto-reject on a translated version alone, because the translation can add abuse that was not there. And record the reviewer's language on the decision, so an audit can show that a Tagalog speaker, not a machine, closed a Tagalog case.

The workflow side of this, from flag to final action, is covered in From Flag to Fix and, for marketplace queues specifically, in the review queue triage guide.

Testing before a full rollout

Run a shadow mode for a week. Score every message, act on nothing, and store the level, the recommendation and the language alongside the outcome your reviewers reach anyway. Then compare.

A small harness is enough to start:

import json, urllib.request
def score(text, source="shadow-test"):
    req = urllib.request.Request(
        "https://v2.greipapi.com/score/text",
        data=json.dumps({"text": text, "source": source}).encode(),
        headers={
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json",
        },
    )
    with urllib.request.urlopen(req) as r:
        return json.load(r)["data"]
for message in ["sample message one", "sample message two"]:
    print(score(message))

Feed it the messages your reviewers already closed, in each language you run, and count where the level disagreed with the human decision. That count, split by language, is your rollout plan.

What the score cannot tell you

The endpoint reads text. It does not know that two users are friends, that a word is reclaimed inside a community, or that a thread is a coordinated pile-on. It does not see images, video or voice, and it will not catch abuse built from emoji sequences or from a screenshot posted as an image.

Pair the text signal with the account around it. A new account with a clean first message and a hosting IP behaves differently from an established account having a bad day. VPN and proxy detection and IP location data can sit next to the text decision in the same rule, which is the practical reason to run moderation and fraud signals behind one key.

Cost and plan fit

Profanity detection is included in the Standard plan, which lists 170,000 requests per month, one webhook and one integration, at $29 monthly or $290 billed annually. Check the pricing page before sizing, because a shadow mode on every message can multiply your volume quickly, and a sampled shadow mode usually answers the same question for a fraction of the calls.

The Content Moderation service page lists what the endpoint covers, and the content moderation integration guide walks through wiring it into a message flow. For implementation detail in a Node.js app, see the JavaScript profanity filter walkthrough. If evasion is your main problem rather than language, the guide to leet speak and hidden insults covers that separately, and gaming communities are covered in the ML filter guide for games.

FAQ

Does profanity detection work in languages other than English?

Coverage varies by model and by language, and a vendor's language count is not evidence for your traffic. Test with real messages from your own platform in each language you run, including slang and code-mixed text, and compare the level and recommendation with what your speakers expect.

What do risk_level and recommendation mean?

risk_level is low, medium or high and reflects the most severe match in the text. recommendation turns that level into accept, review or reject. Both come back with execution_ms for latency tracking.

Should I translate messages into English before scoring them?

Translation helps when your target language has few resources and the translation quality is good, and it introduces errors when the abuse is dialect, slang or sarcasm. If you translate, keep the original text for review and treat the translated score as triage rather than a final decision.

Can I use one threshold for every language?

You can, but it will over-flag some languages and under-flag others. Set the action per level per language, then track late reports on accepted messages in each language to see whether the threshold holds.

Does a low risk level mean the text is safe for every audience?

No. A low level means the text did not match the abuse the model knows. Irony, coded insults and community-specific slurs can come back low, which is why a sample of accepted messages still needs a human read.

How do I handle slang and code-mixed text?

Score the whole message rather than splitting it by language, keep a sample of accepted messages for review, and send the vendor examples of terms your community uses so they can be added. Code-mixed messages belong in your test set from the first day.

Get started

Start protecting your business today

Our service is trusted by thousands of businesses worldwide.

  • 1,000 requests during trial
  • Cancel anytime

Related Articles