Modified category keyword cleaning algorithm