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.2.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.2-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nlpsych-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 aff51cd78b0b4dc415a2aadd9b5770d31c311b97c2e29f4fe6d193d25dd9931c
MD5 c91a6f3c79db7987950cbcb37a473918
BLAKE2b-256 935632c9d2827ee7279f4c2697b7ccf3da1c1cec72b0d590e4632d7f663c1e2f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nlpsych-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03d8f1a1280d05a2399c8438f486b78f8dc7b974380b73c260d119307ff2ea10
MD5 c772d6327c4fbbeb00dd5fc801030aa3
BLAKE2b-256 060dc7e61645a7ae31a58b3841a52b48f3ae9f3ad67c29fefa94de8a27362647

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