prevents an index error when patents have less than top_n words