Skip to content

use surprisal (rather than perplexity) to estimate reading times - #55

Merged
mschrimpf merged 18 commits into
mainfrom
mschrimpf/reading_times-cross_entropy
Sep 2, 2022
Merged

mschrimpf merged 18 commits into
mainfrom
mschrimpf/reading_times-cross_entropy

Conversation

@mschrimpf

Copy link
Copy Markdown
Member

No description provided.

@mschrimpf mschrimpf changed the title ues cross entropy (rather than perplexity) to estimate reading times use cross entropy (rather than perplexity) to estimate reading times Aug 23, 2022
@mschrimpf
mschrimpf requested a review from hans August 31, 2022 12:01

@hans hans left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this is coming in delayed!

Comment thread tests/test_models/test_huggingface.py Resolved
Comment thread tests/test_models/test_huggingface.py Resolved
Comment thread tests/test_models/test_huggingface.py Resolved
@mschrimpf mschrimpf changed the title use cross entropy (rather than perplexity) to estimate reading times use surprisal (rather than perplexity) to estimate reading times Sep 2, 2022
@mschrimpf
mschrimpf merged commit 85afdae into main Sep 2, 2022
@mschrimpf
mschrimpf deleted the mschrimpf/reading_times-cross_entropy branch September 2, 2022 01:20
mschrimpf added a commit that referenced this pull request Sep 2, 2022
mschrimpf added a commit that referenced this pull request Sep 2, 2022
* add specific gpt2 model instances

* restructure directories following #50

* adapt to #55
mschrimpf added a commit that referenced this pull request Oct 26, 2022
* ues cross entropy (rather than perplexity) to estimate reading times

* use bits instead of nats

following @hans's comment #55 (comment)

* pass in all preceding context to compute reading times

* adapt tests to context processing

* remove -1, keep reading times positive

* task head options; separate representation function; trim whitespaces for next-word

* separate `_setup_hooks` method

* note that implementation can also be used for sentence reading times (sum over word surprisals)

* minor comment fixes

* fix typo in test

* add more edge-case tests for RT task

* output NaN when first input region is just one token, and so there is no defined RT

* exclude first word reading times from comparison

* update single-word reading time to nan, and per-sequence

* absolute instead of relative imports

Co-authored-by: Jon Gauthier <[email protected]>
mschrimpf added a commit that referenced this pull request Oct 26, 2022
* add specific gpt2 model instances

* restructure directories following #50

* adapt to #55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants