Skip to main content

Extracts keywords with 'TF-IDF' algorithm

Project description

"topicextractor" extracts topic keywords from documents based on 'TF-IDF' algorithm.

Usage

import topicextractor as te

sample_docs = [["doc1_str"], ["doc2_str"], ["doc3_str"] ....]

#extract noun counts from 'sample_docs' (yon can omit this step and preprocess the data in your own way)

count_container = te.extract_noun_counts(sample_docs)

print(count_container) [{"a": 3, "b": 2}, {"c": 5, "d":3}, {"e": 7, "f": 12} ....]

#extract keywords for 'count_container[0]'(=the first docmunet in 'sample_docs')

keywords = te.tfidf(count_container[0], count_container)

print(keywords) [("keyword1", 2.1104),("keyword2" 2.0012),("keyword3", 1.8892) ....]

Thanks, and please contact the author via e-mail for any comment.

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

topicextractor-0.0.0.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

topicextractor-0.0.0-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

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