← Back to index

Personality Analysis System

A sophisticated trait-based personality analysis tool that helps companies find candidates whose personalities best match specific job descriptions. The system analyzes personality traits using friendliness and dominance scores to create compatibility rankings.

Features

Installation

Prerequisites

Setup Steps

  1. Clone the Repository bash git clone <repository-url> cd traits

  2. Set Up Virtual Environment (Recommended) bash python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate

  3. Install Dependencies bash python setup_dependencies.py # Or manually install required packages: pip install scipy numpy

  4. Initialize the System ```bash # Set up directories and databases python setup_directories.py

# Populate default traits python populate_traits_db.py ```

Usage

Command Line Interface

The tool provides a comprehensive CLI with the following commands:

Trait Operations

# Create a new personality trait
python main.py trait create <name> <friendliness> <dominance>

# List all available traits
python main.py trait list

Examples:

# Create a trait for being detail-oriented
python main.py trait create "detail_oriented" 7.0 5.0

# Create a trait for being creative
python main.py trait create "creative" 8.0 6.0

Person Operations

# Create a new person profile
python main.py person create "<full_name>"

# Add personality description to a person
python main.py person add_desc "<name>" "<description>"

# List all person profiles
python main.py person list

Examples:

# Create person profiles
python main.py person create "Alice Johnson"
python main.py person create "Bob Smith"

# Add personality descriptions
python main.py person add_desc "Alice Johnson" "friendly, collaborative team player with strong leadership qualities"
python main.py person add_desc "Bob Smith" "analytical, detail-oriented problem solver who works well independently"

Company Matching

# Find candidates matching a job description
python main.py company query "<company_name>" "<job_description>"

Examples:

# Match for a leadership position
python main.py company query "TechCorp" "seeking innovative leader with strong communication skills"

# Match for a research position
python main.py company query "ResearchLab" "looking for analytical, detail-oriented researcher who can work independently"

Complete Workflow Example

# 1. Set up some traits
python main.py trait create "innovative" 9.0 8.0
python main.py trait create "analytical" 3.0 4.0
python main.py trait create "collaborative" 8.0 5.0

# 2. Create candidate profiles
python main.py person create "Sarah Chen"
python main.py person create "Mike Rodriguez"
python main.py person create "Emma Davis"

# 3. Add personality descriptions
python main.py person add_desc "Sarah Chen" "innovative and creative problem solver with strong leadership skills"
python main.py person add_desc "Mike Rodriguez" "analytical and detail-oriented researcher who prefers working independently"
python main.py person add_desc "Emma Davis" "collaborative team player who excels in group settings"

# 4. Find matches for different job types
python main.py company query "InnovationTeam" "seeking creative innovators for our R&D department"
python main.py company query "ResearchDept" "looking for independent analytical thinkers"
python main.py company query "MarketingTeam" "need collaborative team players for our creative campaigns"

Project Architecture

Core Components

Command Modules

Database Schema

Persons Table

CREATE TABLE persons (
    person TEXT PRIMARY KEY,
    friendliness REAL DEFAULT 0.0,
    dominance REAL DEFAULT 0.0,
    n_friendliness INTEGER DEFAULT 0,
    n_dominance INTEGER DEFAULT 0
)

Traits Table

CREATE TABLE traits (
    trait TEXT PRIMARY KEY,
    friendliness REAL,
    dominance REAL
)

Technical Details

Personality Analysis Algorithm

  1. Trait Extraction: Natural language descriptions are parsed to identify known personality traits
  2. Weighted Averaging: Personality scores are calculated using weighted averages, giving more influence to recent traits
  3. Compatibility Scoring: Euclidean distance between personality vectors determines candidate-job fit
  4. Dynamic Updates: Personality profiles update automatically as new trait information is added

Default Traits

The system comes pre-loaded with these personality traits:

Development

Running Tests

python -m pytest tests/

Database Management

# Reset and repopulate databases
python populate_db.py

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

License

This project is licensed under the MIT-0 License - see the LICENSE file for details.

Support

For bug reports or feature requests, please open an issue in the project repository.