ValueError: unable to interpret topic as either a list of tokens or a list of ids

57 Views Asked by At

i want to get the coherence for my model, however, it returns the evalue error instead

topic_id_to_name = {
-1: ['obligation', 'intelligence', 'interview', 'responsibility', 'assistance', 'support', 'participate', 'ability', 'effectiveness', 'conducted'],
0: ['projectsprogrammes', 'planning', 'methodology', 'management', 'designing', 'collaboration', 'achieving', 'stakeholder', 'taskcentered', 'project'],
1: ['hypotenuse', 'pythagorean', 'triangle', 'angle', 'trigonometric', 'tangent', 'semicircle', 'quadrilateral', 'circle', 'segment'],
2: ['ballhandling', 'basketball', 'badminton', 'ball', 'softball', 'baseman', 'volleyball', 'tennis', 'scoring', 'foul'],
3: ['communication', 'speech', 'communicate', 'communicative', 'conversation', 'communicated', 'verbal', 'messagesinstructions', 'nonverbal', 'communicator'],
4: ['deviance', 'deviant', 'criminality', 'socialconflict', 'deviate', 'crime', 'sociological', 'criminal', 'bribery', 'criminology'],
}

topic_names = [topic_id_to_name[topic_id] for topic_id in topics]

coherence_model = CoherenceModel(topics=topic_names, texts=your_corpus, dictionary=your_dictionary, coherence='c_v')
coherence_score = coherence_model.get_coherence()
0

There are 0 best solutions below