Hi Lee,
Good job !
I am interested in your project, however when I try to run your program. I find something are missing, Like patentAnalysisMatrix.
Is that possible to share a complete code or example? So that I can read and understand your processing.