• Stars
    star
    115
  • Rank 304,098 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tools to easily create a word cloud

Cloudia

Tools to easily create a word cloud.

from string

from str or List[str]

from cloudia import Cloudia

text1 = "text data..."
text2 = "text data..."

# from str
Cloudia(text1).plot()

# from list
Cloudia([text1, text2]).plot()

example from : 20 Newsgroups

sample_img

We can also make it from Tuple.

from cloudia import Cloudia

text1 = "text data..."
text2 = "text data..."
Cloudia([ ("cloudia 1", text1), ("cloudia 2", text2) ]).plot()

Tuple is ("IMAGE TITLE", "TEXT").

from pandas

We can use pandas.

df = pd.DataFrame({'wc1': ['sample1','sample2'], 'wc2': ['hoge hoge piyo piyo fuga', 'hoge']})

# plot from df
Cloudia(df).plot()

# add df method
df.wc.plot(dark_theme=True)

from pandas.DataFrame or pandas.Series.

pandas_img dark_img

We can use Tuple too.

Cloudia( ("IMAGE TITLE", pd.Series(['hoge'])) ).plot()

from japanese

We can process Japanese too.

text = "これはCloudiaのテストです。WordCloudをつくるには本来、形態素解析の導入が必要になります。Cloudiaはmecabのような形態素解析器の導入は必要はなくnagisaを利用した動的な生成を行う事ができます。nagisaとjapanize-matplotlibは、形態素解析を必要としてきたWordCloud生成に対して、Cloudiaに対して大きく貢献しました。ここに感謝の意を述べたいと思います。"

Cloudia(text).plot()

from japanese without morphological analysis module.

japanese_img

No need to introduce morphological analysis.

Install

pip install cloudia

Args

Cloudia args.

Cloudia(
  data,    # text data
  single_words=[],    # It's not split word list, example: ["neural network"]
  stop_words=STOPWORDS,    # not count words, default is wordcloud.STOPWORDS
  extract_postags=['名詞', '英単語', 'ローマ字文'],    # part of speech for japanese
  parse_func=None,    # split text function, example: lambda x: x.split(',')
  multiprocess=True,    # Flag for using multiprocessing
  individual=False    # flag for ' '.join(word) with parse 
)

plot method args.

Cloudia().plot(
    dark_theme=False,    # color theme
    title_size=12,     # title text size
    row_num=3,    # for example, 12 wordcloud, row_num=3 -> 4*3image
    figsize_rate=2    # figure size rate
)

save method args.

Cloudia().save(
    file_path,    # save figure image path
    dark_theme=False,
    title_size=12, 
    row_num=3,
    figsize_rate=2
)

pandas.DataFrame, pandas.Series wc.plot method args.

DataFrame.wc.plot(
  single_words=[],    # It's not split word list, example: ["neural network"]
  stop_words=STOPWORDS,    # not count words, default is wordcloud.STOPWORDS
  extract_postags=['名詞', '英単語', 'ローマ字文'],    # part of speech for japanese
  parse_func=None,    # split text function, example: lambda x: x.split(',')
  multiprocess=True,    # Flag for using multiprocessing
  individual=False,    # flag for ' '.join(word) with parse 
  dark_theme=False,    # color theme
  title_size=12,     # title text size
  row_num=3,    # for example, 12 wordcloud, row_num=3 -> 4*3image
  figsize_rate=2    # figure size rate
)

If we use wc.save, setting file_path args.

Thanks

More Repositories

1

Awesome-Rust-MachineLearning

This repository is a list of machine learning libraries written in Rust. It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers, etc. 🦀
JavaScript
1,397
star
2

lightgbm-rs

LightGBM Rust binding
Rust
56
star
3

wasm_lindera_example

rust + lindera + webassembly + next.js + typescriptで形態素解析するサンプル
TypeScript
39
star
4

twitter_manager

my twitter management app
Jupyter Notebook
25
star
5

nishika_akutagawa_2nd_prize

nishika akutagawa compedition 2nd prize : https://www.nishika.com/competitions/1/summary
Python
25
star
6

rust-machine-learning-api-example

Example of Rust API for Machine Learning
Rust
17
star
7

dajare-python

駄洒落データを検索するコマンド、スクレイピングのためのツールキット
Jupyter Notebook
16
star
8

docker-UTH-BERT

docker for UTH-BERT: https://ai-health.m.u-tokyo.ac.jp/uth-bert
Dockerfile
14
star
9

dajare-detector

Japanese joke detection
Python
13
star
10

rust-ann-search-example

Image search example by approximate nearest-neighbor library In Rust
Rust
12
star
11

pyoklock

pyoklock : python cli digital clock.
Python
10
star
12

tch-rs-pretrain-example-docker

Docker for PyTorch rust bindings `tch`. Example of pretrain model.
Rust
9
star
13

gokart-pipeliner

gokart pipeline project
Python
9
star
14

xontrib-readable-traceback

xonsh readable traceback
Xonsh
8
star
15

rc_files

rcfiles
Vim Script
5
star
16

daughter-first-program

The first program written by my beloved daughter.
4
star
17

luigi_completion

completion for luigi on bash, zsh
Python
4
star
18

label-propagation-rs

Label Propagation Algorithm by Rust. Label propagation (LP) is graph-based semi-supervised learning (SSL). LGC and CAMLP have been implemented.
Rust
4
star
19

gokart_redshells_thunderbolt_example

m3 OSS Collaboration
Jupyter Notebook
2
star
20

gokart-examples

gokart examples for m3 techbook 2
Jupyter Notebook
2
star
21

vaaaaanquish

vaaaaanquish
2
star
22

select-command-using-ptk

select-command-using-ptk
Python
2
star
23

rust-text-analysis

rust-text-analysis
Rust
1
star
24

dlib_detection_python_script

dlib_detection_python_script
Python
1
star