Skip to content

Commit 42cfee1

Browse files
committed
tweaks
1 parent c3d92cb commit 42cfee1

19 files changed

+43
-211
lines changed

docs/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 65553e260e2b05dfb60ba492e17c99bb
3+
config: 0183c84192aed811a4143d8bc43f0455
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/.doctrees/environment.pickle

-6.63 KB
Binary file not shown.
-7.44 KB
Binary file not shown.

docs/.doctrees/text2voice.doctree

-41 Bytes
Binary file not shown.

docs/LLMs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ <h2>4. LLMs-Powered Localization<a class="headerlink" href="#llms-powered-locali
434434
<div class="bottom-of-page">
435435
<div class="left-details">
436436
<div class="copyright">
437-
Copyright &#169; 2025, Zhipeng
437+
Copyright &#169; 2025, Zhipeng Cao
438438
</div>
439439
Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
440440

docs/_sources/localization.md.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
TAPS and PsyFlow make cross-cultural localization efficient by cleanly separating task logic from configuration and content. This modular design allows researchers to adapt paradigms across languages and cultural contexts **without modifying the task code**, promoting global accessibility, reproducibility, and reuse.
44

5+
**Why It Matters**: Localization is essential for making psychological tasks globally accessible and inclusive. By adapting tasks to different languages and cultural contexts, researchers can extend their reach, maintain standardization across implementations, ensure reproducibility of results, and improve usability for diverse participant groups—including children, older adults, and individuals with limited literacy.
6+
7+
8+
**How It Works** In a TAPS-compliant task, all participant-facing content is cleanly separated from the task logic and stored in the `config.yaml` file. Specifically, localization targets the `subinfo_mapping` section (for registration labels and messages) and the `stimuli` section (for all `text` or `textbox` content). This modular structure enables full language adaptation without modifying any core Python code.
9+
510

611
### 1. Manual Adaptation (Quick and Easy)
712

@@ -10,7 +15,7 @@ The simplest way to localize your task is to **manually translate** the `config/
1015
Paste your YAML content directly into an LLM chat window, along with a clear instruction.
1116

1217
**Here's an example prompt:**
13-
```
18+
```{Prompt}
1419
Translate the following YAML fields into Japanese.
1520
1. The right-hand values of subinfo_mapping (e.g., messages, instructional text).
1621
2. The text content of stimuls of text and textbox
@@ -24,7 +29,7 @@ Here is the original yaml content:
2429
**Orignal config.yaml**
2530

2631
To save space we just show the relevant content.
27-
```
32+
```{yaml}
2833
# config.yaml
2934
# === Subject info ===
3035
subinfo_mapping:
@@ -117,7 +122,7 @@ Then copy the translated YAML back into your project and save as a localized con
117122
**Translated config.ja.yaml**
118123

119124
To save space we just show the relevant content.
120-
```
125+
```{yaml}
121126
# config.yaml
122127
# === Subject info ===
123128
subinfo_mapping:

docs/_sources/text2voice.md.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
**How It Works**: `Psyflow` uses Microsoft's `edge-tts`, a cloud-based TTS API that converts text to audio (MP3). The generated voice files are stored in the `assets/` folder, automatically skipped if they already exist (unless `overwrite=True` is specified), and registered into the `StimBank` as new `Sound` stimuli ready for playback.
88

9-
> **Note**: An internet connection is required for TTS generation. Offline tools exist but produce lower-quality audio.
9+
```{Note}
10+
An internet connection is required for TTS generation. Offline tools exist but produce lower-quality audio.
11+
```
1012

1113

1214
### Convert Existing Text Stimuli to Voice

docs/genindex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ <h1 id="index">Index</h1>
254254
<div class="bottom-of-page">
255255
<div class="left-details">
256256
<div class="copyright">
257-
Copyright &#169; 2025, Zhipeng
257+
Copyright &#169; 2025, Zhipeng Cao
258258
</div>
259259
Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
260260

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ <h1>TaskBeacon<a class="headerlink" href="#taskbeacon" title="Link to this headi
281281
<div class="bottom-of-page">
282282
<div class="left-details">
283283
<div class="copyright">
284-
Copyright &#169; 2025, Zhipeng
284+
Copyright &#169; 2025, Zhipeng Cao
285285
</div>
286286
Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
287287

docs/localization.html

Lines changed: 3 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -252,201 +252,18 @@
252252
<section id="task-localization">
253253
<h1>Task Localization<a class="headerlink" href="#task-localization" title="Link to this heading"></a></h1>
254254
<p>TAPS and PsyFlow make cross-cultural localization efficient by cleanly separating task logic from configuration and content. This modular design allows researchers to adapt paradigms across languages and cultural contexts <strong>without modifying the task code</strong>, promoting global accessibility, reproducibility, and reuse.</p>
255+
<p><strong>Why It Matters</strong>: Localization is essential for making psychological tasks globally accessible and inclusive. By adapting tasks to different languages and cultural contexts, researchers can extend their reach, maintain standardization across implementations, ensure reproducibility of results, and improve usability for diverse participant groups—including children, older adults, and individuals with limited literacy.</p>
256+
<p><strong>How It Works</strong> In a TAPS-compliant task, all participant-facing content is cleanly separated from the task logic and stored in the <code class="docutils literal notranslate"><span class="pre">config.yaml</span></code> file. Specifically, localization targets the <code class="docutils literal notranslate"><span class="pre">subinfo_mapping</span></code> section (for registration labels and messages) and the <code class="docutils literal notranslate"><span class="pre">stimuli</span></code> section (for all <code class="docutils literal notranslate"><span class="pre">text</span></code> or <code class="docutils literal notranslate"><span class="pre">textbox</span></code> content). This modular structure enables full language adaptation without modifying any core Python code.</p>
255257
<section id="manual-adaptation-quick-and-easy">
256258
<h2>1. Manual Adaptation (Quick and Easy)<a class="headerlink" href="#manual-adaptation-quick-and-easy" title="Link to this heading"></a></h2>
257259
<p>The simplest way to localize your task is to <strong>manually translate</strong> the <code class="docutils literal notranslate"><span class="pre">config/config.yaml</span></code> file. This is ideal when you’re using LLMs interactively (e.g., ChatGPT, Gemini, DeepSeek, Claude).</p>
258260
<p>Paste your YAML content directly into an LLM chat window, along with a clear instruction.</p>
259261
<p><strong>Here’s an example prompt:</strong></p>
260-
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>Translate the following YAML fields into Japanese.
261-
1. The right-hand values of subinfo_mapping (e.g., messages, instructional text).
262-
2. The text content of stimuls of text and textbox
263-
3. Do not modify YAML structure, indentation, or key names.
264-
4. Preserve placeholder variables such as {field}, {duration}, {block_num} exactly as they are.
265-
5. For multiline text fields, preserve line breaks and do not introduce extra quotation marks or escape characters.
266-
6. Do not include any commentary, markdown, or explanation—output the translated YAML only.
267-
7. Output the full yaml content in a code block
268-
Here is the original yaml content:
269-
</pre></div>
270-
</div>
271262
<p><strong>Orignal config.yaml</strong></p>
272263
<p>To save space we just show the relevant content.</p>
273-
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># config.yaml
274-
# === Subject info ===
275-
subinfo_mapping:
276-
subject_id: &quot;被试号&quot;
277-
subname: &quot;被试姓名(拼音)&quot;
278-
age: &quot;年龄&quot;
279-
gender: &quot;性别&quot;
280-
Male: &quot;男&quot;
281-
Female: &quot;女&quot;
282-
registration_failed: &quot;注册失败。&quot;
283-
registration_successful: &quot;注册成功!&quot;
284-
invalid_input: &quot;字段 {field} 输入无效&quot;
285-
286-
# === Stimuli (for SST task) ===
287-
stimuli:
288-
fixation:
289-
type: text
290-
text: &quot;+&quot;
291-
color: white
292-
293-
no_response_feedback :
294-
type: text
295-
text: |
296-
【未按键】
297-
请在箭头出现后按键
298-
font: SimHei
299-
height: 0.78
300-
301-
block_break:
302-
type: text
303-
text: |
304-
【休息提示】
305-
306-
第 {block_num} / {total_blocks} 部分完成。
307-
击中率:{go_accuracy:.2f}
308-
正确停止率:{stop_accuracy:.2f}
309-
310-
请在充分休息后按【空格键】
311-
进入下一部分
312-
color: white
313-
font: SimHei
314-
height: 0.78
315-
316-
317-
instruction_text:
318-
type: textbox
319-
text: |
320-
【停止信号任务说明】
321-
322-
在本任务中,您将看到箭头指向左或右
323-
您的目标是尽快且准确地做出反应
324-
- 如果箭头指向左,请用左手食指按【F】
325-
- 如果箭头指向右,请用右手食指按【J】
326-
327-
注意:在某些试次中
328-
箭头出现后不久会出现红色箭头
329-
当看到红色箭头时
330-
请尽力抑制您的反应不要按任何按键
331-
332-
在没有红色箭头出现时,请快速做出反应
333-
出现红色箭头时,请尽量不做出任何按键反应
334-
335-
准备好后,请按【空格键】开始任务。
336-
color: white
337-
font: SimHei
338-
alignment: center
339-
letterHeight: 0.78
340-
units: deg
341-
size: [20, 5]
342-
343-
iti_stim:
344-
type: text
345-
text: &quot;&quot;
346-
347-
good_bye:
348-
type: textbox
349-
text: |
350-
任务结束
351-
352-
感谢您的参与
353-
请按【空格键】键退出
354-
color: white
355-
font: SimHei
356-
alignment: center
357-
letterHeight: 0.78
358-
359-
</pre></div>
360-
</div>
361264
<p>Then copy the translated YAML back into your project and save as a localized config file, e.g., <code class="docutils literal notranslate"><span class="pre">config.ja.yaml</span></code>.</p>
362265
<p><strong>Translated config.ja.yaml</strong></p>
363266
<p>To save space we just show the relevant content.</p>
364-
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># config.yaml
365-
# === Subject info ===
366-
subinfo_mapping:
367-
subject_id: &quot;被験者ID&quot;
368-
subname: &quot;被験者氏名(ローマ字)&quot;
369-
age: &quot;年齢&quot;
370-
gender: &quot;性別&quot;
371-
Male: &quot;男性&quot;
372-
Female: &quot;女性&quot;
373-
registration_failed: &quot;登録に失敗しました。&quot;
374-
registration_successful: &quot;登録に成功しました!&quot;
375-
invalid_input: &quot;フィールド {field} の入力が無効です&quot;
376-
377-
# === Stimuli (for SST task) ===
378-
stimuli:
379-
fixation:
380-
type: text
381-
text: &quot;+&quot;
382-
color: white
383-
384-
no_response_feedback :
385-
type: text
386-
text: |
387-
【未反応】
388-
矢印が表示されたらキーを押してください
389-
font: SimHei
390-
height: 0.78
391-
392-
block_break:
393-
type: text
394-
text: |
395-
【休憩のお知らせ】
396-
397-
第 {block_num} / {total_blocks} ブロックが完了しました。
398-
命中率:{go_accuracy:.2f}
399-
正しく停止できた割合:{stop_accuracy:.2f}
400-
401-
十分に休憩した後、【スペースキー】を押して
402-
次のブロックに進んでください
403-
color: white
404-
font: SimHei
405-
height: 0.78
406-
407-
instruction_text:
408-
type: textbox
409-
text: |
410-
【ストップシグナル課題の説明】
411-
412-
この課題では、矢印が左または右を指します。
413-
できるだけ素早く正確に反応してください。
414-
- 矢印が左を指したら、左手の人差し指で【F】を押してください。
415-
- 矢印が右を指したら、右手の人差し指で【J】を押してください。
416-
417-
注意:一部の試行では、
418-
矢印の直後に赤い矢印が表示されることがあります。
419-
赤い矢印が表示されたら、
420-
反応を抑えてキーを押さないようにしてください。
421-
422-
赤い矢印が表示されなければ、すぐに反応してください。
423-
赤い矢印が表示された場合は、できるだけ反応しないでください。
424-
425-
準備ができたら【スペースキー】を押して課題を開始してください。
426-
color: white
427-
font: SimHei
428-
alignment: center
429-
letterHeight: 0.78
430-
units: deg
431-
size: [20, 5]
432-
433-
iti_stim:
434-
type: text
435-
text: &quot;&quot;
436-
437-
good_bye:
438-
type: textbox
439-
text: |
440-
課題終了
441-
442-
ご参加ありがとうございました
443-
【スペースキー】を押して終了してください
444-
color: white
445-
font: SimHei
446-
alignment: center
447-
letterHeight: 0.78
448-
</pre></div>
449-
</div>
450267
</section>
451268
<section id="programmatic-localization-via-api">
452269
<h2>2. Programmatic Localization via API<a class="headerlink" href="#programmatic-localization-via-api" title="Link to this heading"></a></h2>
@@ -494,7 +311,7 @@ <h2>3. Important Notes on Task Localization<a class="headerlink" href="#importan
494311
<div class="bottom-of-page">
495312
<div class="left-details">
496313
<div class="copyright">
497-
Copyright &#169; 2025, Zhipeng
314+
Copyright &#169; 2025, Zhipeng Cao
498315
</div>
499316
Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
500317

0 commit comments

Comments
 (0)