I am doing an experiment using gensim. I use the lda model to get a probability vector that looks like this:
[(0, 0.01666666666666804), (1, 0.01666666666666982), (2, 0.01666666666667857),
(3, 0.016666666666667104), (4, 0.016666666666668519), (5, 0.01666666666666838),
(6, 0.016666666666681464), (7, 0.016666666666669494), (8, 0.016666666666669269),
(9, 0.016666666666667069), (10, 0.016666666668398125), (11, 0.016666666666666666),
(12, 0.51666666666481131), (13, 0.01666666666668485), (14, 0.01666666666666948),
(15, 0.016666666666667097), (16, 0.016666666666666666), (17, 0.016666666666666767),
(18, 0.016666666666667922), (19, 0.016666666666678695), (20, 0.016666666666667683),
(21, 0.016666666666677307), (22, 0.016666666666669522), (23, 0.016666666666675913),
(24, 0.016666666666670923), (25, 0.016666666666667409), (26, 0.016666666666680405),
(27, 0.016666666666666666), (28, 0.0166666666666705), (29, 0.016666666666668353)]
This is a list consisting of tuples, the first component of the tuple is the topic, and the second is the probability:
(topic, probability)
I would like to get 5 topics with the highest probability in the list of tuples as follows:
max = [(topicN, probability),...]
I tried first converting this tuple to a numpy structure as follows:
vector = lda[ques_vec]
print(vector)
types = numpy.dtype('int,float')
data = numpy.array(vector,dtype=types)
print(data)
However, I'm not sure how to arrange this structure to get a list of five tuples with the highest probabilities, so I would like to evaluate the support.