尔忘恰当时为了处置那个成就,团队熬了佳多少个今夜,写了一堆if-else逻辑:
#晚期 的"土法炼钢"式考核
def old_school_audit(text, image_path):
# 文原枢纽词汇检测
banned_words = ["犯禁词汇1", "犯禁词汇2", ...]
for word in banned_words:
if word in text:
return False
# 图象哈希比对于
image_hash = calculate_hash(image_path)
if image_hash in banned_image_hashes:
return False