Topic Modeling Package
Project description
An NLP package for topic modeling on the Holy Scripture and other text from low-code to pro-code
Installation
$ pip install wordtm
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 wordtm import meta, util, ta, tm, viz, pivot, quot
version Submodule
Provides some version information.
import wordtm
print(wordtm.__version__)
meta Submodule
Provides extracting source code of wordtm 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
wordtm was created by Johnny Cheng. It is licensed under the terms of the MIT license.
Credits
wordtm was created under the guidance of Jehovah, the Lord.
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
Built Distribution
File details
Details for the file wordtm-0.4.6.tar.gz
.
File metadata
- Download URL: wordtm-0.4.6.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d716277f648b4e76bf4c85430e4ebc8f87bf0cb30b96cb8b0062737d67d4f747 |
|
MD5 | 9237b7140e08257bdba183359c1f0e21 |
|
BLAKE2b-256 | 6c33f330615a8873af446386d2d7ae7c6707f2272f684ef85b1cb2f4eeb4b565 |
File details
Details for the file wordtm-0.4.6-py3-none-any.whl
.
File metadata
- Download URL: wordtm-0.4.6-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a7a06bcc77389ed2bab30a3f3667c30714473908a6b8279a3ce4aef6ca57936 |
|
MD5 | 691f04773d4e9d7e4464e6f731994b36 |
|
BLAKE2b-256 | ee1c1001144e2cc29c7442485ec49fdd2068b0315d1ba893c493a6d2c3ae7c12 |