functions to persist corpus and word frequencies in redis db