def topicModelLSI(self,twits, keyword): ''' irrespc of collection fetch the pratenId=1 tweets and merge them together with the curreent tweets from twitter AJX call then run topic modeling ''' topicModelObj = topicModel.topicModel(twits) dictionary = topicModelObj.createDictionary(keyword) corpus = [] for vector in topicModelObj: corpus.append(vector) #print(corpus) return topicModelObj.createLSIModel(corpus,'',keyword)
def topicModelLSI(self,twits, keyword): ''' irrespc of collection fetch the pratenId=1 tweets and merge them together with the curreent tweets from twitter AJX call then run topic modeling ''' topicModelObj = topicModel.topicModel(twits) dictionary = topicModelObj.createDictionary(keyword) corpus = [] for vector in topicModelObj: corpus.append(vector) if len(corpus): return topicModelObj.createLSIModel(corpus,'',keyword) else: return 0
def posAnalysis(self, twits): topicModelObj = topicModel.topicModel(twits) topicModelObj.tryPos()