Python tool to generate word count matrices