{'fraction_non_alphanumeric': 0.027151935297515885, 'fraction_numerical': 0.0017331022530329288, 'mean_word_length': 5.055944055944056, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Let the Algorithm Speak: How to Use Neural Networks for Automatic Item Generation in Psychological Scale Development

Measurement is at the heart of scientific research. As many—perhaps most—psychological constructs cannot be directly observed, there is a steady demand for sound self-report scales to assess such latent constructs. However, scale development is a tedious process that requires researchers to produce good items in large quantities. In the current tutorial, we introduce, explain, and apply the Psychometric Item Generator (PIG), an open-source, free-to-use, self-sufficient natural language processing algorithm that produces large-scale, human-like, customised text output within a few mouse clicks. The PIG is based on the GPT-2, a powerful generative language model, and runs on Google Colaboratory—an interactive virtual notebook environment that executes code on state-of-the-art virtual machines at no cost. We demonstrate that based on an input of three sentences, the PIG produces 65 items that pass initial face validity checks within a single iteration of code and a runtime of less than one minute. The PIG does not require any prior coding skills or access to computational resources and can be easily tailored to any desired context by simply switching out short linguistic prompts in a single line of code. Additionally, the PIG can also be used as a bottom-up tool to expand and diversify the conceptual understanding of a construct or derive hypotheses about its relationships to other, existing constructs. In short, we present an effective, novel machine learning solution to an old psychological challenge. As such, the PIG will not only not require you to learn a new language—but speak yours.