Re: Error on output TopTokensScore

31 views
Skip to first unread message

Мурат Апишев

unread,
Jul 17, 2019, 9:00:21 AM7/17/19
to Елена Реутт, bigartm-users
Hello, can you inspect the content of tokens variable and attach it here?


 ---
С уважением, Мурат Апишев.
 
Regards, Murat Apishev.



17.07.2019, 11:41, "Елена Реутт" <ereu...@gmail.com>:
Hello.
I run the following code:

 tokens = model.score_tracker['top_words'].last_tokens
for topic_name in model.topic_names:
    print('{}: '.format(topic_name)),
    for token in tokens[topic_name]:
         print(token),
    print()

And get the following error:

KeyError                                  Traceback (most recent call last)
<ipython-input-54-f93faadc3d4f> in <module>()
      2 for topic_name in model.topic_names:
      3     print('{}: '.format(topic_name)),
----> 4     for token in tokens[topic_name]:
      5          print(token),
      6     print()

KeyError: 'topic_4'

Help me, please

--
You received this message because you are subscribed to the Google Groups "bigartm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigartm-user...@googlegroups.com.
To post to this group, send email to bigart...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bigartm-users/35289afb-afd5-4a07-ac28-c690d81742b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Елена Реутт

unread,
Jul 17, 2019, 9:34:35 AM7/17/19
to bigartm-users
Thank you for your response, but unfortunately not. I'll try to understand

среда, 17 июля 2019 г., 16:00:21 UTC+3 пользователь great-mel написал:
To unsubscribe from this group and stop receiving emails from it, send an email to bigart...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages