wulijun / php-ext-trie-filter

php extension for spam word filter based on Double-Array Trie tree, it can detect if a spam word exists in a text message. 关键词过滤扩展,用于检查一段文本中是否出现敏感词,基于Double-Array Trie 树实现。
514 stars 167 forks source link

对于几十万的词库怎么提升效率? #18

Open hjy2588818 opened 5 years ago

hjy2588818 commented 5 years ago

几十万词库的怎么提高效率?实际测试中使用了将近300万的词量,检测一篇文本大概需要十几秒

wulijun commented 5 years ago

要么换一个更好的关键词检测方法,要么你把关键词切分成几个子集,每个子集起服务,同一篇文章并发发给这几个服务检测,然后把检测结果做个合并。