topicwizard icon indicating copy to clipboard operation
topicwizard copied to clipboard

Compatibility for Chinese

Open jsnleong opened this issue 2 years ago • 3 comments

Hi! Thanks for this awesome package!

Currently am applying this package on Chinese language text corpus. The output generated are "empty squares" - the reason behind this is that we need to use explicit Language fonts (.tff file which I have). Any idea how to incorporate this external font file to this package for use?

Thanks!

jsnleong avatar Mar 22 '23 08:03 jsnleong

Hello! Is it all graphs, or is this only the wordclouds?

x-tabdeveloping avatar Apr 03 '23 06:04 x-tabdeveloping

This Stackoverflow thread could be of use to you.

Since topicwizard is essentially just a dash app, you can deal with this the same way they do. For the main file I would use the get_dash_app function so that you have a more direct access to the underlying application object. I can't confirm if this actually works, but it's worth a try ;)

x-tabdeveloping avatar Apr 03 '23 07:04 x-tabdeveloping

As for the wordclouds, I will try to expose the font API somehow, I will post to this thread when I've made progress.

x-tabdeveloping avatar Apr 03 '23 07:04 x-tabdeveloping

Sorry for delaying this so long, but I've gotten around to do it! I will ping you when the new release is out!

x-tabdeveloping avatar Jan 03 '25 14:01 x-tabdeveloping

I have added custom fonts for word clouds!

# pip install topicwizard>=1.1.3
topicwizard.visualize(topic_data=topic_data, wordcloud_font_path="NotoSansTC-Bold.ttf")

x-tabdeveloping avatar Jan 03 '25 14:01 x-tabdeveloping