A text embedding analysis pipeline for perception modeling
Project description
perceptionML
A text embedding analysis pipeline for perception modeling and topic discovery.
Features
- Generate text embeddings using state-of-the-art models (Sentence Transformers, OpenAI, etc.)
- Dimensionality reduction with UMAP or PCA
- Advanced clustering with HDBSCAN
- Interactive HTML visualizations
- Topic analysis and statistics
- Support for zero-presence analysis and category comparisons
- Multi-GPU support for large datasets
Installation
pip install perceptionml
Quick Start
Simplest Usage - No Configuration Needed!
Just point to your CSV file with text:
perceptionml --data your_data.csv
perceptionML will automatically:
- Detect your text column (longest text)
- Find or create an ID column
- Identify numeric columns as outcomes
- Generate synthetic outcomes if no numeric columns exist
- Use optimal settings for finding many detailed topics
What Your Data Should Look Like
Minimal CSV (just text):
text
"This is my first document about..."
"Another document with different content..."
CSV with outcomes to analyze:
id,text,sentiment_score,rating
1,"Great product, highly recommend!",0.95,5
2,"Terrible experience, would not buy again",-0.87,1
Basic Options
# Specify output file name
perceptionml --data your_data.csv --output my_analysis.html
# Sample large datasets
perceptionml --data your_data.csv --sample-size 10000
# Use specific embedding model
perceptionml --data your_data.csv --embedding-model nvidia/NV-Embed-v2
# Export results to CSV
perceptionml --data your_data.csv --export-csv
Advanced Usage
For more control, you can:
-
Use configuration files for complex setups
-
Adjust clustering granularity:
# Many small topics (default) perceptionml --data your_data.csv --auto-cluster many # Medium-sized topics perceptionml --data your_data.csv --auto-cluster medium # Few large topics perceptionml --data your_data.csv --auto-cluster few
-
Override specific parameters:
perceptionml --data your_data.csv \ --min-cluster-size 30 \ --umap-neighbors 15
Understanding the Output
The HTML visualization shows:
- 3D scatter plot of your texts, clustered by topic
- Topic keywords extracted from each cluster
- Statistics about outcomes in different regions
- Interactive controls to explore the data
Click on points to read the original texts. Use the controls to filter by outcome values or focus on specific topics.
Requirements
- Python 3.8+
- CUDA-capable GPU recommended for faster embedding generation
- 4GB+ RAM for typical datasets
Support
- Documentation: https://github.com/raymondli/perceptionml
- Issues: https://github.com/raymondli/perceptionml/issues
- Author: Raymond V. Li (raymond@raymondli.me)
License
See LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file perceptionml-0.1.0.tar.gz.
File metadata
- Download URL: perceptionml-0.1.0.tar.gz
- Upload date:
- Size: 125.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e85dd7059f615ff610554bde331f71777997f33c7b64f14596d181198dee23a1
|
|
| MD5 |
876da7fbaa8c86d82006e2526964b8bb
|
|
| BLAKE2b-256 |
0ca9854a510d5308646e60a8f6b0ac8fa97cb56cb02c4e0bf4ebda98c83f10be
|
File details
Details for the file perceptionml-0.1.0-py3-none-any.whl.
File metadata
- Download URL: perceptionml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 140.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae023cfe39e689fc4bbb12aafa103c87191ddc319b1535945eba650eb08ed035
|
|
| MD5 |
018af1f400e39839a87ad6ee586ea5a3
|
|
| BLAKE2b-256 |
1f5a8f4d18d0a19a9fa52417f6d1dedd7784a67bde2daa7ce754331de3307dc2
|