JasonKessler / scattertext

Beautiful visualizations of how language differs among document types.
Apache License 2.0
2.23k stars 289 forks source link

Trouble met when using chinese_nlp #16

Closed geekinglcq closed 6 years ago

geekinglcq commented 6 years ago

Thanks for this cool job you have done first! Here I meet a problem when using chinese_nlp. If I have import jieba in my own code, and then data['text'] = data['text'].apply(chinese_nlp), python will throw an error like followings:

         59   if 'jieba' not in sys.modules:
         60      jieba = __import__('jieba')
---->    61   return jieba.cut
         62

NameError: name 'jieba' is not defined

However if I don't import jieba in my code, the problem won't occur.

Your Environment

JasonKessler commented 6 years ago

Thanks for reporting this! Taking a look right now.

JasonKessler commented 6 years ago

I'm pushing out 2.9.10 as we speak. This should resolve the issue.