astrique
ASk The RIght QUEstions: An active machine learning framework for perception experiments
Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.9%) to scientific vocabulary
Repository
ASk The RIght QUEstions: An active machine learning framework for perception experiments
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 2
Metadata Files
README.md
Bachelor's Thesis
AsTRiQue is described in detail in my bachelor's thesis (Institute of Phonetics, Faculty of Arts, Charles University). You can download the thesis here.
MEDAL Poster Presentation
AsTRiQue was presented as a flash talk and poster at the MEDAL Summer School of Computational Modeling in Birmingham on June 24, 2025. You can download the poster here.
Reference
[1] Kocjančič, T., & Bořil, T. (2025). Voicing in Czech children’s sibilants: children’s productions and adult’s perception, International Clinical Phonetics and Linguistics Association (ICPLA), June 24-27, 2025, Patras.
AsTRiQue
ASk The RIght QUEstions: An active machine learning framework for perception experiments
AsTRiQue is a tool designed to streamline perception experiments that involve large amounts of stimuli. In traditional perception experiments, participants often have to classify a large number of items, which can be time-consuming and tiring. AsTRiQue minimizes this burden through active learning; a kind of machine learning where a model is continuously updated based on the participant’s input to decide what to ask next, following in the footsteps of Einfeldt et al. (2024).
The experiment starts by selecting a few stimuli for the participant ("oracle") to classify (using a grid-based sampling strategy). Based on the answers, a logistic regression model is trained to predict how the participant might respond to all the remaining stimuli. Then, the model picks the stimulus it is most uncertain about (uncertainty sampling). By targeting these hard-to-predict cases, the model learns much faster.
To keep things balanced, there is also an option to occasionally include a very easy (high-certainty) stimulus as a “cleanser” to reduce participant fatigue from repetitive difficult stimuli.
This process repeats: the participant answers, the model updates, and a new uncertain stimulus is selected. Once the model is confident enough in its predictions of all the stimuli the participant hasn't been presented with (based on a pre-determined confidence value), the experiment ends.
To test and evaluate this model, there is an option to use a lookup table as the oracle (as a so-called virtual agent) instead of a human participant.
ℹ️ Example Chart
In this example, a virtual agent simulated participant 3 from Kocjančič and Bořil (2025) with the following config in AsTRiQue:
python
STRATIFIED_SAMPLING_RESOLUTION = 3 # resolution of the n by n grid from which samples are taken
MIN_ITERATIONS = 30 # minimum number of iterations
CLEANSER_FREQUENCY = 0 # insert a high-certainty sample every nth iteration to prevent participant fatigue (irrelevant for virtual agents); 0 to disable
MODEL_CERTAINTY_CUTOFF = 0.95 # stopping certainty threshold
PARTICIPANT_TO_MODEL = 'p03' # participant ID to simulate
The oracle (virtual agent) classified 57 stimuli out of 104. The remaining 47 were classified by the model with a 97.9% accuracy. This specific case would, with a human participant, translate to reducing the participant workload by about 45% while still producing data that is nearly as reliable as if the participant had answered every item themselves—with an effective overall accuracy of over 99% (including the participant's answers).
Of course, this is an exceptionally good scenario; the model's efficiency can be impacted by the source data and especially by the participant's predictability (the less consistent the participant is in in their answers, the more difficult it is to model them in the first place).

🧑🏾 Human Workflow Showcase
If you'd like to see AsTRiQue in action with yourself as the participant, you can run the participant.ipynb notebook locally or check out the showcase notebook online.
In the notebook, you'll be asked to classify all 104 stimuli. The model will stop training after the confidence threshold is reached, the rest of your classifications will be used to evaluate the model's performance.
🤖 Virtual Agent Showcase
Not feeling like doing the perception experiment yourself? You can still see AsTRiQue in action by running the virtual_agent.ipynb notebook locally or checking out the virtual agent showcase notebook online. Instead of querying you as the oracle, the model will query a lookup table of a real participant who took part in the original experiment.
📊 Dataset
The showcase makes use of data from Kocjančič and Bořil (2025), where they investigated categorization of Czech sibilants /s/ vs. /z/ and /ʃ/ vs. /ʒ/ as a function of two acoustic parameters: voicing (quantified as the percentage of the segment exhibiting periodic vocal fold vibration) and segmental duration (in ms). For the purposes of the showcase, /s/ and /ʃ/ were batched together, as were /z/ and /ʒ/.
🗂️ Data Structure
📁 data/data.csv
This spreadsheet contains the filenames of all recordings used in the experiment, as well as their parameters (voicing and duration).
| filename | voicing | duration | | -------------------- | ------- | -------- | | NJ8sC0File017.wav | 0 | 72 | | NJ1zV8File036.wav | 8 | 127 | | ... | ... | ... |
📁 data/participants/p01.csv
This spreadsheet contains participant 1's answers in the real experiment. | filename | answerbatch | | -------------------- | ------------ | | NJ8sC0File017.wav | s | | ... | ... |
⚙️ Config & Technical Stuff
The model takes two numbers (e.g. voicing and duration) as predictors for a binary classification (e.g. batched /s/ /ʃ/ vs. batched /z/ /ʒ/)
```python
data structure config
PREDICTOR1 = 'voicing' # first predictor column name PREDICTOR2 = 'duration' # second predictor column name TARGET = 'answer' # target column name FILENAMECOL = 'filename' # filename column name LABELMAPPING = {'s': 0, 'z': 1} # binary output label mapping DATAPATH = 'data/data.csv' # sound info data file path PARTICIPANTCSV_DIR = 'data/participants' # participant CSV directory
model parameters
STRATIFIEDSAMPLINGRESOLUTION = 3 # resolution of the n by n grid from which samples are taken MINITERATIONS = 20 # minimum number of iterations MODELCERTAINTYCUTOFF = 0.95 # stopping certainty threshold PARTICIPANTTO_MODEL = 'p01' # participant ID to simulate ```
🔄 Customization Tips
- See how
MODEL_CERTAINTY_CUTOFFaffects the number of samples collected and prediction quality - Human participant: see how
CLEANSER_FREQUENCYaffects fatigue (by preventing long stretches of ambiguous stimuli) - Virtual agent: simulate other participants by changing
PARTICIPANT_TO_MODEL
References
Einfeldt, M., Sevastjanova, R., Zahner-Ritter, K., Kazak, E., & Braun, B. (2024). The use of Active Learning systems for stimulus selection and response modelling in perception experiments. Computer Speech & Language, 83, 101537. https://doi.org/10.1016/j.csl.2023.101537
Kocjančič, T., & Bořil, T. (2025). Voicing in Czech children’s sibilants: children’s productions and adult’s perception, International Clinical Phonetics and Linguistics Association (ICPLA), June 24-27, 2025, Patras.
Owner
- Name: Prokop Hanžl
- Login: prokophanzl
- Kind: user
- Location: Prague, Czech Republic
- Website: dustah.com
- Repositories: 1
- Profile: https://github.com/prokophanzl
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: AsTRiQue
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Prokop
family-names: Hanžl
email: prokophanzl03@gmail.com
affiliation: 'Institute of Phonetics, Charles University'
orcid: 'https://orcid.org/0009-0005-4193-6934'
repository-code: 'https://github.com/prokophanzl/astrique'
abstract: >-
Perception experiments in phonetics can be time-consuming,
often requiring participants to label large amounts of
stimuli. This proposed framework reduces participant
workload by continuously updating a logistic regression
model to select the most informative stimuli, making
high-certainty predictions for the rest. Using simulated
participants based on real data, the system achieved high
classification accuracy while significantly lowering the
number of required participant responses. These results
demonstrate the potential of active machine learning to
streamline data collection in perception experiments.
keywords:
- active learning
- machine learning
- phonetics
- perception experiments
- perception testing
license: GPL-3.0
date-released: '2025-09-10'
GitHub Events
Total
- Push event: 78
- Create event: 2
Last Year
- Push event: 78
- Create event: 2
Dependencies
- numpy *
- pandas *
- scikit-learn *