The bag-of-words method with dictionary analysis by evolutionary algorithm