跳转到内容

用模糊文本做鼠标追踪阅读(MoTR)

无需眼动仪,通过模糊除鼠标指针附近之外的文本来测量每个词的阅读时间,并把理解题保留到阅读结束之后。

v2.15.0 新增

cursor_reveal 方案把条目的文本显示为模糊状态,只有鼠标指针附近的词是清晰的。读者沿着每一行移动指针来阅读文本,Potato 记录指针的路径,带有时间戳,以及每个采样时指针下的词。研究可以从存储的路径得到每个词的阅读时间、对较早词语的回视,以及总阅读时间,实验室里不需要眼动仪。这个方案适合在网页浏览器中运行的心理语言学阅读研究,理解题可以等到读者按下结束阅读的按钮之后再出现。

眼动追踪是测量读者注视每个词多长时间的标准方法,而首次通过阅读时间和回视这类眼动指标通常需要实验室硬件。Wilcox、Ding、Sachan 和 Jäger(2024)提出的阅读的鼠标追踪(MoTR)改用鼠标来测量增量式阅读。文本被模糊,只有鼠标指针周围的区域是清晰的,指针的路径代替读者的视线。Potato 的 cursor_reveal 方案实现了 MoTR 的显示并存储采样,分析代码再根据采样计算每个词的指标。

配置

下面的配置把每个句子显示为模糊状态,并在每个句子之后问一个问题。label_requirement 在 Potato 存储了一次阅读之前一直阻止"下一个"按钮:

yaml
annotation_task_name: "Read with the mouse"
task_dir: .
data_files:
  - data/passages.jsonl
item_properties:
  id_key: id
  text_key: text
output_annotation_dir: annotation_output/
export_annotation_format: jsonl
user_config:
  allow_all_users: true
 
annotation_schemes:
  - annotation_type: cursor_reveal
    name: reading
    description: "Move the mouse pointer along the sentence to read it"
    radius: 40
    blur: 4
    label_requirement:
      required: true
 
  - annotation_type: radio
    name: comprehension
    description: "How well did you understand the sentence?"
    labels: ["Fully", "Partly", "Not at all"]

方案读取条目的 text_key 字段,这里是 text。data/passages.jsonl 的每一行是一个条目:

json
{"id": "s1", "text": "The black cat slept quietly on the kitchen windowsill all afternoon."}

选项

cursor_reveal 选项默认值含义
name必填方案名称,也是阅读记录存储时使用的键
description必填显示在文本上方的说明
source_fieldtext_key 字段保存文本的条目字段
radius40指针所在行上,距指针多远(像素)以内的词保持清晰,从 5 到 400
blur4其他词的模糊程度,单位为像素,从 0 到 40
sample_ms20两次记录的指针采样之间的最短间隔,单位为毫秒,从 5 到 1000
finish_buttonfalse用一个按钮结束阅读。true 把按钮标为"I've finished reading",不超过 80 个字符的字符串则设置按钮文字
hide_after_finishtrue读者按下结束按钮后隐藏文本。该选项需要 finish_button
label_requirement无{required: true} 在存储了阅读记录之前一直阻止"下一个"按钮

Potato 在服务器启动时检查这些选项,遇到超出上述范围的值,或不带 finish_button 的 hide_after_finish,会停止并给出信息。

指针附近的清晰词语

Potato 按空白字符把文本拆成词,并把词显示为纯文本。条目字段中的 HTML 标记不会被渲染。指针所在行上、距指针 radius 像素以内的词是清晰的,其余保持模糊。页面上任何位置出现文本的清晰副本,都会让读者绕过模糊。因此,当方案读取主文本字段时,页面会隐藏标注方案上方通常显示的清晰文本副本。通过 source_field 读取另一个字段的方案,则让主文本保持在屏幕上。

没有结束按钮时,Potato 在指针离开文本时保存阅读记录,并在页面因其他任何原因(例如"下一个"按钮)保存之前保存。再次访问某个条目时,新的采样会追加到已存储的采样之后,新的时间戳接着最后一个已存储的采样继续。

需要鼠标或触控板

这个方案需要鼠标或触控板。触摸屏没有悬停,在手机或平板上文本会一直保持模糊。请在招募文字中告知参与者,研究需要一台带鼠标或触控板的电脑。

阅读之后的理解题

阅读研究通常在段落读完之后才显示理解题,因为提前看到问题的读者可以在段落中寻找答案。设置 finish_button 后,文本下方有一个按钮来结束阅读。只有读者按下按钮时,Potato 才存储阅读记录,记录随之停止,文本也被隐藏,除非 hide_after_finish 为 false。因此,在阅读方案上用 not_empty 运算符通过 display_logic 控制的问题,会一直隐藏到按下按钮为止。

当每个条目有单独的问题时,把问题文本放在条目字段中,并在 instance_display 里为该字段设置同样的规则。下面的配置在读者读完之后,把问题字段和答案方案一起显示出来:

yaml
annotation_task_name: "Mouse-tracking reading with comprehension questions"
task_dir: .
data_files:
  - data/passages.jsonl
item_properties:
  id_key: id
  text_key: text
output_annotation_dir: annotation_output/
export_annotation_format: jsonl
user_config:
  allow_all_users: true
 
instance_display:
  fields:
    - key: question
      type: text
      label: "Question"
      display_logic:
        show_when:
          - {schema: reading, operator: not_empty}
 
annotation_schemes:
  - annotation_type: cursor_reveal
    name: reading
    description: "Move the mouse pointer along the text to read it, then press the button."
    radius: 40
    blur: 4
    sample_ms: 20
    finish_button: "I've finished reading"
    label_requirement:
      required: true
 
  - annotation_type: radio
    name: comprehension
    description: "Answer the question about the passage."
    labels: ["Yes", "No"]
    display_logic:
      show_when:
        - {schema: reading, operator: not_empty}
    label_requirement:
      required: true

每个条目带有段落和该段落的问题:

json
{"id": "p01", "text": "The council met on Tuesday evening, and after two hours of debate the vote on the new bus route was postponed until spring.", "question": "Was the vote on the bus route held on Tuesday?"}

instance_display 块只列出 question 字段,段落只出现在 cursor_reveal 方案内部,并且是模糊的。Potato 发送的问题字段是隐藏的,只在检查规则之后才显示问题。即便如此,问题文本仍然在页面源码中,打开 HTML 的读者可以在那里找到问题。在回答之后显示字段完整介绍了字段规则。

规划研究时,这个按钮还有三种行为需要考虑:

  • 过早按下。 指针还没有扫过文本时,读者就按下按钮,Potato 会请读者先阅读文本。
  • 回到已完成的条目。 已完成的条目在读者回来时显示问题,文本保持隐藏,Potato 不会向已存储的阅读记录添加任何内容。
  • 未按按钮就离开。 读者在按下按钮之前离开的阅读记录,Potato 不会存储。对于带结束按钮的方案,服务器也会拒绝没有 "finished": true 的保存阅读记录。

存储的值

Potato 把每次阅读存储为方案名称下的一个 JSON 字符串,无论方案叫什么,标签键都是 reading:

json
{"reading": {"reading": "{\"words\": [\"The\", \"black\", \"cat\"], \"samples\": [[0, 0.02, 0.4, 0], [20, 0.05, 0.4, 0], [40, 0.11, 0.4, 1]], \"dwell\": [40, 20, 0]}"}}

这个 JSON 字符串最多包含四个键:

  • words 按顺序列出文本中的词。
  • samples 每个采样列出一项 [t, x, y, word]。t 是从文本显示起算的毫秒数,x 和 y 是指针位置占文本框的比例,word 是指针下的词的索引,指针下没有词时为 -1。
  • dwell 给出指针在每个词上停留的总时间,单位为毫秒。
  • finished 在读者按下结束按钮之后为 true,只出现在带 finish_button 的方案上。

分析代码根据 samples 计算每个词的首次通过阅读时间、回视(较晚的采样落在较早的词上)和总阅读时间,就像眼动研究处理注视点那样。服务器会拒绝时间顺序错乱的采样、落在文本框之外的采样,以及指向文本中不存在的词的采样,每个条目最多接受 50,000 个采样。在默认的 sample_ms 20 下,50,000 个采样覆盖一个条目上超过 16 分钟的指针移动。无论导出格式如何,标注都会保存到 annotation_output/<user>/user_state.json,jsonl 导出以同样的 JSON 字符串携带阅读记录。

示例

Potato 的发行版包含一个两句话的鼠标追踪示例。请在 Potato 检出目录的根目录下启动示例:

bash
potato start examples/advanced/mouse-tracking-reading/config.yaml -p 8000

示例询问读者对每个句子的理解程度,没有结束按钮。添加 finish_button 和上面配置中的 display_logic 规则,就能把问题保留到阅读结束,然后把 data_files 指向你自己的段落。

延伸阅读

有关实现细节,请参阅源文档。

参考文献

  • Wilcox, E. G., Ding, C., Sachan, M., and Jäger, L. A. (2024). Mouse Tracking for Reading (MoTR): A new naturalistic incremental processing measurement tool. Journal of Memory and Language, 138, 104534. https://doi.org/10.1016/j.jml.2024.104534