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

ValueError in data_analysis.py on the call of .generate() of WordCloud #34

Open
yasirfaizahmed opened this issue Feb 17, 2024 · 0 comments

Comments

@yasirfaizahmed
Copy link

yasirfaizahmed commented Feb 17, 2024

About
Wanted to convert .zip to a .md files

To Reproduce
All default inputs are given by pressing just "Return" for all asked inputs like shown below

? Enter the path to the zip file : /home/xd/Downloads/b455353cfb9d91342741e3be5caf32bac5bfdc3200a5c2ed274d8b606825027
6-2024-02-17-18-37-08.zip
? Enter the path to the output folder : /home/xd/Documents/ChatGPT Data
? Enter the message header (#) for messages from 'system' : ### System
? Enter the message header (#) for messages from 'user' : # Me
? Enter the message header (#) for messages from 'assistant' : # ChatGPT
? Enter the message header (#) for messages from 'tool' : ### Tool output
? Select the LaTeX math delimiters you want to use : default
? Select the YAML metadata headers you want to include : done (9 selections)
? Select the font you want to use for the word clouds : RobotoSlab-Thin
? Select the color theme you want to use for the word clouds : prism
? Enter custom stopwords (separated by commas) : use, file

Expected behavior

Done ✅ ! Check the output 📈 here : file:///home/xd/Documents/ChatGPT%20Data/Graphs 🔗

(more graphs 📈 will be added in the future ...)

Creating weekly wordclouds 🔡☁️ :   0%|                                                       | 0/41 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/__main__.py", line 5, in <module>
    main()
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/cli.py", line 76, in main
    generate_wordclouds(
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/long_runs.py", line 70, in generate_wordclouds
    week_groups[week].wordcloud(**kwargs).save(
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/models/_conversation_set.py", line 150, in wordcloud
    return generate_wordcloud(text, **kwargs)
  File "/home/xd/.local/lib/python3.10/site-packages/convoviz/data_analysis.py", line 117, in generate_wordcloud
    ).generate(text)
  File "/home/xd/.local/lib/python3.10/site-packages/wordcloud/wordcloud.py", line 642, in generate
    return self.generate_from_text(text)
  File "/home/xd/.local/lib/python3.10/site-packages/wordcloud/wordcloud.py", line 624, in generate_from_text
    self.generate_from_frequencies(words)
  File "/home/xd/.local/lib/python3.10/site-packages/wordcloud/wordcloud.py", line 453, in generate_from_frequencies
    self.generate_from_frequencies(dict(frequencies[:2]),
  File "/home/xd/.local/lib/python3.10/site-packages/wordcloud/wordcloud.py", line 511, in generate_from_frequencies
    box_size = draw.textbbox((0, 0), word, font=transposed_font, anchor="lt")
  File "/usr/lib/python3/dist-packages/PIL/ImageDraw.py", line 671, in textbbox
    raise ValueError("Only supported for TrueType fonts")
ValueError: Only supported for TrueType fonts

Screenshots
Screenshot from 2024-02-18 00-28-40

OS

  • linux 6.5.0-17-generic, Ubuntu 22.04.1, python3.10.12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant