Skip to content

Psycholinguistics experiments using the latest version of OpenAI models GPT4.1-mini and GPT4o-mini

License

Notifications You must be signed in to change notification settings

WordsGPT/Expression_Spanish

Repository files navigation

Expression Spanish

Initial configuration

  1. Install dependencies by running:

    pip install -r requirements.txt
  2. Configure your OpenAI API key by copying apis_example.env to apis.env and setting your API key:

    cp apis_example.env apis.env

    Then edit apis.env and replace "your-api-key" with your actual OpenAI API key.

Experiment structure

Each experiment folder should contain:

  • config.yaml: Configuration file with experiment definitions
  • data/: Dataset files (CSV or Excel)
  • prompts/: Text files containing prompts for each experiment
  • batches/: Generated batch files (created by prepare_experiment.py)
  • results/: Results from OpenAI API (downloaded by execute_experiment.py)
  • outputs/: Final processed results (created by generateResults.py)

Make estimations with some model:

  1. Prepare the experiment by running:

    python prepare_experiment.py <EXPERIMENT_NAME> <EXPERIMENT_PATH>

    This generates the batch files from your configuration.

    Available EXPERIMENT_NAME options:

    Option Description
    <experiment_name> Process specific experiment
    all Process all existing experiments in config.yaml
    failed Retry failed experiments
    status Show failed experiments
  2. Run the experiment by executing:

    python execute_experiment.py <EXPERIMENT_NAME> <EXPERIMENT_PATH>

    This executes the batches and automatically downloads results when completed.

    Available EXPERIMENT_NAME options:

    Option Description
    <experiment_name> Process specific experiment
    all Process all existing experiments in the batches folder
    failed Retry failed experiments
    remain Check and download batches still in tracking
    status Show batches still in tracking

Generate results:

  1. Execute:

    python generateResults.py <EXPERIMENT_NAME> <EXPERIMENT_PATH>

    This processes the downloaded results and generates a .xlsx file in the folder outputs/<EXPERIMENT NAME>

    Available EXPERIMENT_NAME options:

    Option Description
    <experiment_name> Process specific experiment
    all Process all existing experiments that have batches and results (in the bathces and results folders respectively)
    failed Retry failed experiments
    status Show failed experiments

About

Psycholinguistics experiments using the latest version of OpenAI models GPT4.1-mini and GPT4o-mini

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages