Skip to main content

Topic Modeling Toolkit

Project description

A topic modeling toolkit on the Holy Scripture and other text from low-code to pro-code

Installation

$ pip install cwordtm

Usage

wordtm can be used to perform some NLP pre-processing tasks, text exploration, including Chinese one, text visualization (word cloud), and topic modeling (BERTopic, LDA and NMF) as follows:

from cwordtm import meta, util, ta, tm, viz, pivot, quot

version Submodule

Provides some version information.

import cwordtm
print(cwordtm.__version__)

meta Submodule

Provides extracting source code of cwordtm module and adding timing and code-showing features to all functions of the module.

print(meta.get_module_info())

print(meta.get_module_info(detailed=True))

meta.addin_all()

quot Submodule

Provides functions to extract the quotation source Scripture in OT based on the presribed NT Scripture.

cdf = util.load_word('cuv.csv')
crom8 = util.extract2(cdf, 'Rom 8')

quot.show_quot(crom8, lang='chi')

pivot Submodule

Provides a pivot table of the prescribed text.

cdf = util.load_word('cuv.csv')

pivot.stat(cdf, chi=True)

ta Submodule

Provides text analytics functions, including extracting the summarization of the prescribed text.

cdf = util.load_word('cuv.csv')
crom8 = util.extract2(cdf, 'Rom 8')

ta.summary(rom8, code=True)

tm Submodule

Provides text modeling functions, including LDA, NMF and BERTopics modeling.

lda = tm.lda_process("cuv.csv", chi=True, eval=True, timing=True)

nmf = tm.nmf_process("cuv.csv", chi=True, eval=True, code=1)

btm = tm.btm_process("cuv.csv", chi=True, cat='nt', eval=True)

util Submodule

Provides loading text and text preprocessing functions.

df = util.load_word()
cdf = util.load_word('cuv.csv')

df.head()
cdf.head()

rom8 = util.extract2(df, 'Rom 8')
crom8 = util.extract2(cdf, 'Rom 8')

viz Submodule

Wordcloud plotting from the prescribed text.

cdf = util.load_word('cuv.csv')

viz.chi_wordcloud(cdf)

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

cwordtm was created by Johnny Cheng. It is licensed under the terms of the MIT license.

Credits

cwordtm was created under the guidance of Jehovah, the Lord.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cwordtm-0.5.0.tar.gz (18.2 MB view details)

Uploaded Source

Built Distribution

cwordtm-0.5.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file cwordtm-0.5.0.tar.gz.

File metadata

  • Download URL: cwordtm-0.5.0.tar.gz
  • Upload date:
  • Size: 18.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for cwordtm-0.5.0.tar.gz
Algorithm Hash digest
SHA256 695c864efce2f52db4049c45623cbe207b9c33411009cb9734eb195e6aaa26a9
MD5 baa1931487899c6f8fccccb823c9a369
BLAKE2b-256 370b53ae2a5f7a5482a88edbca1b2b29a41d58cc1abc9f860e0498566af52151

See more details on using hashes here.

File details

Details for the file cwordtm-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: cwordtm-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for cwordtm-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 835297a4256685de5e7965d31df568c20d9bd5e00148e513da487a2acd602b30
MD5 8afcf3b7ed51bf89a3951a0e93eb0942
BLAKE2b-256 ac68d2045ab22094b0f6f4c36633d6b85429ade4ea174d7ab83a443dfca4b349

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page