Toolbox for Japanese text.
Project description
Shikaku (詩客)
Toolbox for Japanese text.
Example
from shikaku import load_aozorabunko, TextModel, WordCloud
import matplotlib.pyplot as plt
# Aozora Bunko, author_id = 35, work_id = 1567 ==> Run, Melos!
text = load_aozorabunko(35, 1567)
# Text generator using Markov chains.
model = TextModel()
model.fit(text)
result = model.generate()
print(result)
# Word cloud.
wc = WordCloud()
wc.fit(text)
result = wc.generate()
result.to_file("wc.png")
# Visualize Markov chains (preliminary).
model = TextModel(state_size=1)
model.fit("吾輩は猫である。名前はまだない。")
model.plot()
plt.savefig("model.png")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shikaku-0.2.3rc1.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for shikaku-0.2.3rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db7305efa58bb254d1246879dd080197461f1d230da0c4d3bd1463557ef679ab |
|
MD5 | e30ab5a6daf6bd8ddd9240ccdd286083 |
|
BLAKE2b-256 | 3a87d9f4a5d3199aa7e3e2e9679e14a6fd082c3ad19f82f10a1815d25b2d37c3 |