A topic modeling toolkit on the Holy Scripture and other text from low-code to pro-code
$ pip install cwordtm
cwordtm
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
Provides some version information.
import cwordtm
print(cwordtm.__version__)
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))
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')
Provides a pivot table of the prescribed text.
cdf = util.load_word('cuv.csv')
pivot.stat(cdf, chi=True)
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_chi(crom8)
Provides text modeling functions, including LDA, NMF and BERTopics modeling.
lda = tm.lda_process("web.csv", eval=True, timing=True)
nmf = tm.nmf_process("web.csv", eval=True, code=1)
btm = tm.btm_process("cuv.csv", chi=True, cat='ot', eval=True)
btm = tm.btm_process("cuv.csv", chi=True, cat='nt', eval=True, code=2)
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')
Wordcloud plotting from the prescribed text.
cdf = util.load_word('cuv.csv')
viz.chi_wordcloud(cdf)
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.
cwordtm
was created by Johnny Cheng. It is licensed under the terms of the MIT license.
cwordtm
was created under the guidance of Jehovah, the Lord.