gregversteeg/corex_topic

eror in vis_hierarchy

vvssttkk opened this issue · 10 comments

when I running
vt.vis_hierarchy([topic_model, tm_layer2, tm_layer3],column_label=words, max_edges=200, prefix='topic-model-example')

I get

NameError                                 Traceback (most recent call last)
<ipython-input-99-9a4b427527bd> in <module>
      1 vt.vis_hierarchy([topic_model, tm_layer2, tm_layer3],
----> 2                  column_label=words, max_edges=200, prefix='topic-model-example')

~/env/py36/lib/python3.6/site-packages/corextopic/vis_topic.py in vis_hierarchy(corexes, column_label, max_edges, prefix, n_anchors)
     58         inds = np.where(alpha[j] >= 1.)[0]
     59         inds = inds[np.argsort(-alpha[j, inds] * mis[j, inds])]
---> 60         group_number = u"red_" + unicode(j) if j < n_anchors else unicode(j)
     61         label = group_number + u':' + u' '.join([annotate(column_label[ind], corexes[0].sign[j,ind]) for ind in inds[:6]])
     62         label = textwrap.fill(label, width=25)

NameError: name 'unicode' is not defined

I fixed code
u can find them here d94a06e

if u get some errors in jupyter, copy this file into your notebook

download tests/d3_files/force.html u can from https://github.com/gregversteeg/LinearSieve

Hi. I am getting the same 'unicode' error. How to fix this?

Hi. I am getting the same 'unicode' error. How to fix this?

do u saws this

unfortunately, separate in the file I can't run code

Sorry, i dont understand whats mentioned there. Do you mean copy this file - https://github.com/gregversteeg/LinearSieve/blob/master/tests/d3_files/force.html ? Copy to where and how to run a html file in jupyter notebook ? Do you have an example?

Sorry, i dont understand whats mentioned there. Do you mean copy this file - https://github.com/gregversteeg/LinearSieve/blob/master/tests/d3_files/force.html ? Copy to where and how to run a html file in jupyter notebook ? Do you have an example?

do u copy the code from corextopic import vis_topic to your notebook?
u should create a separate function in the raw like that:
image

and class Corex(object): before like that:
image

Ah. Got it. Thanks, it worked. :)

Thank you for the help @vtrokhymenko.

@JeevaGanesan sorry for the inconvenience. @vtrokhymenko made a pull request that fixed this (#21), but it hasn't been updated on pip yet. I'll try to update soon.

Cool thanks.