Skip to main content

Tools for text analysis, embeddings, and lightweight modeling with a Streamlit app interface.

Project description

NLPsych logo

NLPsych

NLPsych (Natural Language Psychometrics) lets you upload a CSV file, pick your text columns, and get instant descriptive statistics, visualize semantic embeddings, and run predictive models all in one streamlined workflow.

โš™๏ธ Features

  • ๐Ÿ“Š Descriptive statistics: word counts, sentence lengths, lexical diversity
  • ๐Ÿ”Ž Embeddings: Sentence-Transformers + dimensionality reduction (PCA, UMAP, t-SNE)
  • ๐Ÿค– Modeling: Quick logistic regression / ridge regression with cross-validation + permutation tests
  • ๐Ÿ“‘ Reports: Auto-generated HTML/Markdown reports with interpretations

๐Ÿ’ก Tip: If you only need the functions, install via pip. If you want the interactive app, clone the repo and run it with Streamlit.

๐Ÿ“ฆ Installation (library only)

To use NLPsych functions in your own Python code:

pip install NLPsych

๐Ÿš€ Running the app locally

pip install "NLPsych[app]"
nlpsych-app

๐Ÿ›  Example Usage (library)

import pandas as pd
from nlpsych.descriptive_stats import spacy_descriptive_stats
from nlpsych.embedding import embed_text_columns_simple_base, reduce_embeddings

df = pd.DataFrame({"text": [
    "Hello world. This is a tiny test.",
    "Patient denies chest pain. Vitals stable."
]})

stats_df, overall = spacy_descriptive_stats(df["text"])
print(overall["lexical_diversity"])

meta_df, emb, texts = embed_text_columns_simple_base([df["text"]])
Z = reduce_embeddings(emb, method="pca", n_components=2)

๐Ÿ“‚ Project structure

root/
โ”œโ”€โ”€ .devcontainer/
โ”œโ”€โ”€ .streamlit/   
โ”‚   โ””โ”€โ”€ config.toml
โ”œโ”€โ”€ assets/    
โ”‚   โ””โ”€โ”€ NLPsych_logo.png          
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ nlpsych     
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ descriptive_stats.py
โ”‚   โ”‚   โ”œโ”€โ”€ embedding.py
โ”‚   โ”‚   โ”œโ”€โ”€ modeling.py
โ”‚   โ”‚   โ”œโ”€โ”€ report.py
โ”‚   โ”‚   โ””โ”€โ”€ utils.py
โ”‚   โ”œโ”€โ”€ nlpsych_app/              
โ”‚   โ”‚   โ”œโ”€โ”€ assets/    
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ NLPsych_logo.png          
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ app.py
โ”‚   โ”‚   โ””โ”€โ”€ launch.py
โ””โ”€โ”€ tests/              

๐Ÿ–‹ License

MIT License ยฉ 2025 Shawn Manuel

๐Ÿ‘‡ Contributing

PRs are welcome! If you have feature ideas or bug fixes, feel free to open an issue or submit a pull request.

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

nlpsych-0.1.3.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nlpsych-0.1.3-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file nlpsych-0.1.3.tar.gz.

File metadata

  • Download URL: nlpsych-0.1.3.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for nlpsych-0.1.3.tar.gz
Algorithm Hash digest
SHA256 11c253830bd00f6b8a95b67a4fa27acd02ec0c58bb1c0167179dad64ef1ace9d
MD5 fd5545774233f46f56ba60339cef5157
BLAKE2b-256 05ff496c0cfc863852fc700a84ea4328a98f5e1c370a42ccf895a361c454bad8

See more details on using hashes here.

File details

Details for the file nlpsych-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: nlpsych-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for nlpsych-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3a24a470013633834ece302e6f702d18797e553bfc2da348386afdced43d9ada
MD5 17b0e9372e369c811e72e254a2c9ea58
BLAKE2b-256 f3ca12d521c33a5d123ffb7a0368988d19e913944dd297f0fbbb6a655b4571a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page