Student Persona Generator
A Python package for generating detailed student personas from educational chat conversations using Google's Gemini API.
Overview
The Student Persona Generator analyzes chat conversations between students and educational AI systems to create comprehensive student profiles. These profiles include information about the student's knowledge level, engagement, learning style, interests, and question complexity, providing valuable insights for educators.
Features
- Analyze educational chat conversations stored in JSON format
- Generate detailed student personas with multiple metrics
- Save personas as JSON files for further analysis or integration
- Easy-to-use command-line interface
Installation
# Clone the repository
git clone https://github.com/yourusername/persona_module.git
cd persona_module
# Install the package
pip install -e .
Requirements
- Python 3.6+
- Google Gemini API key
- Required Python packages:
- google-generativeai
- python-dotenv
Usage
Command Line Interface
# Basic usage
persona path/to/chat.json
# Specify output file
persona path/to/chat.json -o output.json
# Provide API key directly
persona path/to/chat.json -k YOUR_API_KEY
If you don't provide arguments, the CLI will prompt you for the required information.
Environment Variables
You can set your Gemini API key as an environment variable:
export GEMINI_API_KEY=your_api_key
Or create a .env file in your project directory:
GEMINI_API_KEY=your_api_key
Python API
from persona import PersonaGenerator
# Initialize the generator
generator = PersonaGenerator("path/to/chat.json", "your_gemini_api_key")
# Generate a persona
persona = generator.generate_persona()
# Save the persona to a file
output_file = generator.save_persona(persona, "output.json")
Input Format
The input JSON file should have the following structure:
{
"subject": "Mathematics",
"title": "Algebra Fundamentals",
"date": "2023-06-15",
"duration": 45,
"student_id": "S12345",
"messages": [
{
"sender": "user",
"content": "I'm having trouble understanding quadratic equations.",
"timestamp": "14:30:15"
},
{
"sender": "bot",
"content": "I'd be happy to help! Let's start with the basics...",
"timestamp": "14:30:45"
},
...
]
}
Output Format
The generated persona is a JSON object with the following structure:
{
"student_profile": {
"knowledge_level": "beginner",
"engagement_level": "highly engaged",
"dominant_learning_style": "analytical",
"primary_interests": ["algebra", "problem-solving"],
"question_complexity": 6,
"engagement_score": 8.5
},
"detailed_analysis": {
"complexity": {
"complexity_score": 6.2,
"avg_message_length": 42,
"follow_up_questions": 5,
"analytical_questions": 3,
"total_questions": 8
},
"engagement": {
"engagement_score": 8.5,
"message_frequency": "high",
"session_duration": 45,
"avg_time_between_messages": 30
},
"interests": {
"top_interests": ["algebra", "problem-solving", "real-world applications"],
"interest_distribution": {
"algebra": 0.6,
"problem-solving": 0.3,
"real-world applications": 0.1
}
},
"learning_style": {
"dominant_style": "analytical",
"style_breakdown": {
"analytical": 0.7,
"practical": 0.2,
"big-picture": 0.1
}
}
},
"summary": "This student is a beginner in algebra who shows high engagement...",
"session_info": {
"subject": "Mathematics",
"title": "Algebra Fundamentals",
"date": "2023-06-15",
"duration": 45,
"student_id": "S12345"
}
}
License
Metadata
Release files for persona-futedu 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| persona_futedu-0.0.1.tar.gz | 6.3 kB | Without provenance | Details for persona_futedu-0.0.1.tar.gz |
Release files / persona_futedu-0.0.1.tar.gz
| Download URL | persona_futedu-0.0.1.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6f84c182f188902f23e056e49961beb53ddc555ac5e2e4f062f7b288d3264e7
|
|
BLAKE2b-256 checksum How to use checksums |
b7bed2674a834ad5fc81d5a3e600b7c1312f7687397723e75f88826bfb90975e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for persona-futedu 0.0.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.