text_analytics
Basic computational linguistics and natural language processing in Python.
pip install textanalytics
pip install git+https://github.com/jonathandunn/text_analytics.git
This package provides code to support introductory courses in computational linguistics or natural language processing. These courses are available free on edX:
Introduction to Text Analytics and Natural Language Processing with Python
Visualizing Text Analytics and Natural Language Processing with Python
Usage
from text_analytics import TextAnalytics
ai = TextAnalytics()
Getting features
style, vocab_size = ai.get_features(df, features="style")
style = Function word n-grams
sentiment = Positive and negative words
content = Top content words with TD-IDF weighting, PMI for finding phrases, no stop words
constructions = A bag-of-constructions syntactic representation
Using a classifier
ai.shallow_classification(df, label, features="style", cv=False, classifier='svm')
ai.mlp(df, label, features="style", validation_set=False, test_size=0.10)
Unsupervised methods
Topic Models
ai.train_lda(df, n_topics, min_count)
topic_df = ai.use_lda(df, labels="Author")
Vector Semantics
ai.train_word2vec(file, min_count, workers)
Document and Word Clusters
cluster_df = ai.cluster(x, y=None, k)
*Nearest document searches
y_sample, y_closest = ai.linguistic_distance(x, y, sample=1, n=3)
Corpus Descriptions
PMI-based Phrases
ai.fit_phrases(df)
Delta P-based Phrases
association_df = ai.get_association(df, min_count = 1, save_phraser = True)
Basic word frequencies
vocab = ai._get_vocab_list(df, min_count, return_freq = True)
Corpus Comparisons
similarity = ai.get_corpus_similarity(df1, df2)
Metadata
Release files for textanalytics 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| textanalytics-1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for textanalytics-1.1-py2.py3-none-any.whl |
Release files / textanalytics-1.1-py2.py3-none-any.whl
| Download URL | textanalytics-1.1-py2.py3-none-any.whl |
|---|---|
| Size | 100.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
72e04587d4599eda7166304872ad8aecadea8f5a1b8a28cf63831654b723de3b
|
|
BLAKE2b-256 checksum How to use checksums |
e18062596bd3b6b8ed4230510935a34c70b45a9b18b144cc60674dedfb8854fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5
|
Security for textanalytics 1.1
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.