catd
A Chinese co-word analysis with topic discovery package.
Overview
The catd co-word analysis with topic discovery package is intend for Chinese corpus analysis.
Use case
For better experience, you can run this script (with your corpus which have list of documents separated by '\n'.)
Corpus('$ProjectRoot/data/original_data/tianya_posts_test_set_10.txt):
documents1
documents2
...
Program:
import catd
import os
corpus = []
with open(os.path.join('data', 'original_data', 'tianya_posts_test_set_10.txt'), encoding='utf-8') as f:
for line in f:
corpus.append(line)
stop_words_set = catd.util.collect_all_words_to_set_from_dir(os.path.join('data', 'stop_words'))
cut_corpus = catd.util.word_cut(corpus, stop_words_set)
word_net = catd.WordNet()
coded_corpus = word_net.generate_nodes_hash_and_edge(cut_corpus)
word_net.add_cut_corpus(coded_corpus)
Note
Now I am working on the efficient visualization for big graph (hundreds of millions of edges).
If you have any question or suggestion, feel free to contact the Author in English or Chinese. But for the benefit of all users, please make communicate in English when it is public.
Data Structure
* WordNet
* nodes list[WordNode1, WordNode2, ...])
* edges dict[word][neighbors] -> weight)
* docs list[Doc1, Doc2, ...]
* get_node_by_str dict[word] -> WordNode
* WordNode
* id
* name
* doc_count
* word_count
* inverse_document_frequency
* Doc
* id
* word_count_in_doc
* word_tf_in_doc
* word_tf_idf
* num_of_words
log
0.3.0
Add support for lda model and topic information aggregation from words.
License
MIT License
Metadata
Release files for catd 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| catd-0.5.0.tar.gz | 13.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| catd-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.1 kB
Release files / catd-0.5.0.tar.gz
| Download URL | catd-0.5.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee6ad25b55697f542260d34c52aaa659409d0ed6da8e9b541796ae395ce2a8aa
|
|
BLAKE2b-256 checksum How to use checksums |
0bcdf767d99931792ae2fda3aeddc881a9ead70c0d9cc4a7d6130c8659c5ed2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / catd-0.5.0-py3-none-any.whl
| Download URL | catd-0.5.0-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3a030223907e1201744dc05d350a5d19d3d03e04ca2139c303f6b409746de70
|
|
BLAKE2b-256 checksum How to use checksums |
2317a226920320e1b5131dd0791a2498d1d0ba45471151174fe6eeac325f4425
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for catd 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.