How do you implement a good profanity filter?

后端 未结 21 2744
误落风尘
误落风尘 2020-11-22 04:27

Many of us need to deal with user input, search queries, and situations where the input text can potentially contain profanity or undesirable language. Oftentimes this needs

21条回答
  •  忘掉有多难
    2020-11-22 05:26

    a profanity filtering system will never be perfect, even if the programmer is cocksure and keeps abreast of all nude developments

    that said, any list of 'naughty words' is likely to perform as well as any other list, since the underlying problem is language understanding which is pretty much intractable with current technology

    so, the only practical solution is twofold:

    1. be prepared to update your dictionary frequently
    2. hire a human editor to correct false positives (e.g. "clbuttic" instead of "classic") and false negatives (oops! missed one!)

提交回复
热议问题