A powerful toolkit for working with synthetic personas, built on top of the PERSONA HUB dataset. This project provides tools for persona analysis, clustering, and message testing across different business roles.
-
Persona Synthesis (
main.py): Generate specialized content from personas including:- Math problems tailored to persona backgrounds
- Instructions based on persona expertise
- NPC characters for gaming contexts
- Knowledge articles from persona perspectives
-
Persona Clustering (
persona_clusters.py):- Automated clustering of personas by business roles
- Support for IT Admin, Executive, Facilities, Retail, and Multifamily roles
- Feature extraction based on role-specific keywords
- Demographic and expertise-based grouping
-
Message Testing (
message_tester.py):- Test marketing messages against specific persona clusters
- Get detailed resonance scores and feedback
- Analyze message effectiveness across different roles
- Generate improvement suggestions based on persona responses
- Install dependencies:
pip install -r requirements.txt- Set up your OpenAI API key in a
.envfile:
OPENAI_API_KEY=your_key_here
- Run persona synthesis:
python main.py- Test messages against personas:
python message_tester.py --messages_file messages.json --output_file results.json --role it_adminpython main.py --template math --sample_size 10
python main.py --template npc --sample_size 10
python main.py --template knowledge --sample_size 10# Test IT-focused messages
python message_tester.py --messages_file it_messages.json --output_file it_results.json --role it_admin
# Test executive-focused messages
python message_tester.py --messages_file exec_messages.json --output_file exec_results.json --role executive# Cluster personas and analyze demographics
python persona_clusters.pymain.py- Main script for persona synthesismessage_tester.py- Tool for testing messages against persona clusterspersona_clusters.py- Persona clustering and analysiscode/prompt_templates.py- Templates for different synthesis tasksrequirements.txt- Project dependencies
{
"message": "Your message here",
"average_score": 7.5,
"detailed_responses": [
{
"resonance_score": 8,
"technical_accuracy": "...",
"operational_impact": "...",
"security_considerations": "...",
"implementation_concerns": [...]
}
],
"key_themes": {...}
}{
"IT_ADMIN": [...],
"EXECUTIVE": [...],
"FACILITIES": [...],
"RETAIL": [...],
"MULTIFAMILY": [...]
}This toolkit facilitates synthetic data creation at scale to simulate diverse inputs from a wide variety of personas. While powerful, it comes with important ethical considerations. Please review the full disclaimer and ethical considerations from the original PERSONA HUB project.
This project is built on top of the PERSONA HUB dataset and toolkit (GitHub), a comprehensive collection of 200,000 synthetic personas created by Tencent AI Lab. We acknowledge and thank the creators of PERSONA HUB for providing this valuable resource.