Giter Site home page Giter Site logo

telegramwordcloud's Introduction

wordcloud

TelegramWordCloud

Generate word cloud from Telegram chat history.

  1. Export Telegram chat history in JSON format from Telegram Desktop.

  2. Clone this repo:

    > git clone https://github.com/Ray-Eldath/TelegramWordCloud
  3. Install dependencies:

    > pip install numpy cython pkuseg click
  4. Run scripts:

    1. main.py: Extract valid sentences from result.json. You could specify ignored sender by specifying option –i. See --help for more explanation.
    2. seg.py: Segment every sentences with pkuseg. You should provide a user dictionary file dict, in which every line is a word in your dictionary. See pkuseg # 参数说明 on how to define your own dictionary or model.
    3. cloud.py: This script will transform the words (which are segmented from sentences in the previous step) into weighted CSV file that could be visualized by WordClouds.com. There are several modes and corresponding parameters to tune, check out --help for more information.
  5. Upload the generated CSV file to WordClouds.com (Word list –> Import CSV) and customize your graph.

Notice

  • This repo uses pkuseg for word tokenization. There are many other options, including jieba and SaaS such as Aliyun NLP 2.0. You could try different services and models to get the desired result. Be aware: user-defined dictionary is essential.
  • Cover image is generated with default parameter set (n=100, mode=group-freq, groups=6). The default group-freq mode can generate the best visualization IMHO, but you can try them out on your own.

telegramwordcloud's People

Contributors

ray-eldath avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.