Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are Chinese characters in my project, but after calling the visualize_document_datamap() method, the characters appear as garbled text. #2211

Open
1 task done
superseanyoung opened this issue Nov 12, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@superseanyoung
Copy link

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Desribe the bug

fig = topic_model.visualize_document_datamap(
sentences,
topics=topics,
reduced_embeddings=reduced_embeddings,
#custom_labels=custom_labels,
title='文档和主题的分布',
sub_title='基于 BERTopic 的主题建模',
width=1200,
height=1200
)
Even after setting
plt.rcParams['font.sans-serif'] = ['SimHei'],
I still can't see the characters.

Reproduction

from bertopic import BERTopic
# with the reduced embeddings
reduced_embeddings = UMAP(n_neighbors=15, n_components=2, min_dist=0.0, metric='cosine').fit_transform(embeddings)
fig = topic_model.visualize_document_datamap(
    sentences,
    topics=topics,
    reduced_embeddings=reduced_embeddings,
    #custom_labels=custom_labels,
    title='文档和主题的分布',
    sub_title='基于 BERTopic 的主题建模',
    width=1200,
    height=1200
)

BERTopic Version

0.16.4

@superseanyoung superseanyoung added the bug Something isn't working label Nov 12, 2024
@MaartenGr
Copy link
Owner

Hmmm, I'm not entirely sure what is needed here. Have you tried posting an issue on the DataMapPlot repository? I think there isn't much to do from my end since I'm just calling that package and passing the data.

@superseanyoung
Copy link
Author

Can the "visualize_document_datamap()" method set font display parameters?

@MaartenGr
Copy link
Owner

@superseanyoung You can check all parameters implemented here or here

@NullPxl
Copy link

NullPxl commented Dec 6, 2024

For future people, please see my reply here: TutteInstitute/datamapplot#50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants