week 5. experiments with psyscript grs lx 865 topics in linguistics

22
Week 5. Experiments with Week 5. Experiments with PsyScript PsyScript GRS LX 865 GRS LX 865 Topics in Topics in Linguistics Linguistics

Post on 22-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Week 5. Experiments with Week 5. Experiments with PsyScriptPsyScript

GRS LX 865GRS LX 865Topics in Topics in

LinguisticsLinguistics

Page 2: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

What we’re doingWhat we’re doing The driver who my neighbor who I trust The driver who my neighbor who I trust

suggested took me to the airport.suggested took me to the airport. The driver who my neighbor who my boss The driver who my neighbor who my boss

trusts suggested took me to the airport.trusts suggested took me to the airport.

Overarching hypothesis:Overarching hypothesis: Sentence Sentence difficulty has to do with holding onto difficulty has to do with holding onto several unsatisfied dependencies. Longer several unsatisfied dependencies. Longer ones are harder to hold.ones are harder to hold.

Question:Question: What measures length? What measures length? Hypothesis:Hypothesis: New referents. New referents.

Page 3: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

How do we see if that’s How do we see if that’s right?right?

Center-embedded sentences are the most Center-embedded sentences are the most taxing, several started dependencies, taxing, several started dependencies, center-most element triple-counted.center-most element triple-counted.

The driver whoThe driver who my neighbor whomy neighbor who II trust … trust …

That’s the most sensitive point, seems to That’s the most sensitive point, seems to be near critical point of processability.be near critical point of processability.

Page 4: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

ExperimentingExperimenting

Does it matter whether we have a known Does it matter whether we have a known referent (referent (II, , youyou) or a new referent () or a new referent (my my neighborneighbor)?)?

To know for sure, we try holding To know for sure, we try holding everything constant except the most everything constant except the most embedded subject and see if there are embedded subject and see if there are differences (which can then be attributed differences (which can then be attributed to the only thing that’s different, the to the only thing that’s different, the properties of the most embedded subject).properties of the most embedded subject).

Page 5: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Building the itemsBuilding the items

The driver who my neighbor who The driver who my neighbor who II trust suggested took me to the airport.trust suggested took me to the airport.

The driver who my neighbor who The driver who my neighbor who John John trusts suggested took me to the trusts suggested took me to the airport.airport.

The driver who my neighbor who The driver who my neighbor who the the housekeeper housekeeper trusts suggested took me trusts suggested took me to the airport.to the airport.

The driver who my neighbor who The driver who my neighbor who they they trust suggested took me to the airport.trust suggested took me to the airport.

Page 6: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Planning the experimentPlanning the experiment Each set of four sentences constitutes a Each set of four sentences constitutes a

token settoken set (a.k.a. (a.k.a. itemitem)) Each item are four Each item are four conditionsconditions (1/2 pronoun, (1/2 pronoun,

name, definite description, 3 pronoun).name, definite description, 3 pronoun). Counterbalancing rules:Counterbalancing rules:

Each subject will judge no more than one Each subject will judge no more than one sentence from each token set.sentence from each token set.

Each subject will judge all conditions and will Each subject will judge all conditions and will see equal numbers of sentences from each see equal numbers of sentences from each conditioncondition

Every sentence in every token set will be judged Every sentence in every token set will be judged by some subject.by some subject.

Page 7: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Trial listsTrial lists

We have four conditions, so we need:We have four conditions, so we need: Four different “scripts” (versions of the Four different “scripts” (versions of the

lists)lists) Some number of fourples of token sets.Some number of fourples of token sets.

E.g., items 1-4, each with conds a-dE.g., items 1-4, each with conds a-d Subj W: 1a, 2b, 3c, 4dSubj W: 1a, 2b, 3c, 4d (script 1)(script 1) Subj X: 1b, 2c, 3d, 4aSubj X: 1b, 2c, 3d, 4a (script 2)(script 2) Subj Y: 1c, 2d, 3a, 4bSubj Y: 1c, 2d, 3a, 4b (script 3)(script 3) Subj Z: 1d, 2a, 3b, 4cSubj Z: 1d, 2a, 3b, 4c (script 4)(script 4)

Page 8: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Our experimentOur experiment We will have 20 items (picked from the ones We will have 20 items (picked from the ones

you submitted) and 20 fillers.you submitted) and 20 fillers. (Note: That’s on the small side for a real (Note: That’s on the small side for a real

experiment)experiment)

Next steps:Next steps: Create the lists of test sentences for the four Create the lists of test sentences for the four

different scripts.different scripts. Spec out and pseudocode our experimentSpec out and pseudocode our experiment Investigate PsyScriptInvestigate PsyScript Run the experimentRun the experiment Deal with the dataDeal with the data

Page 9: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Creating the scriptsCreating the scripts

Our sentences are made of very Our sentences are made of very predictable components:predictable components: The X who/that the Y who/that Z VP1 The X who/that the Y who/that Z VP1

VP2 VP3VP2 VP3 The only thing that changes across The only thing that changes across

conditions is Z, while the rest conditions is Z, while the rest changes across token sets.changes across token sets.

We can use Excel to build these from We can use Excel to build these from their pieces, to avoid unnecessary their pieces, to avoid unnecessary errors.errors.

Page 10: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

WorksheetsWorksheets ComponentsComponents

Subj1Subj1 Rel1Rel1 Subj2Subj2 Rel2Rel2 Subj3aSubj3a Subj3bSubj3b Subj3cSubj3c VP3VP3 VP2VP2 VP1VP1 AnswerAnswer QuestionQuestion

FillersFillers QuestionQuestion AnswerAnswer Regions…Regions…

The way I’ve set it The way I’ve set it up, everything up, everything needs to be exactly needs to be exactly 8 regions long 8 regions long (even the fillers)(even the fillers)

Page 11: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

WorksheetsWorksheets

ConstructedConstructed Computes item Computes item

(token group) and (token group) and condition based on condition based on row number, comes row number, comes up with a code like up with a code like I5V2 (fifth token I5V2 (fifth token group, version 2). group, version 2). Builds the sentence Builds the sentence region by region region by region based on the based on the condition number.condition number.

TablesTables Keeps track of what Keeps track of what

will be on each script.will be on each script. Scripts are divided Scripts are divided

into “blocks”, and into “blocks”, and each block has one of each block has one of each condition and each condition and four fillers, four fillers, randomized.randomized.

Sort column is Sort column is 2*block plus a 2*block plus a random number (to random number (to order the blocks, but order the blocks, but randomly within)randomly within)

Page 12: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

WorksheetsWorksheets ScriptScript

The master script sheetThe master script sheet This generates a script This generates a script

based on the columns based on the columns you put into I1 and J1. you put into I1 and J1. (The column refer to (The column refer to the the tables tables sheet, where sheet, where the item and condition the item and condition numbers will be found)numbers will be found)

B and C for script 1B and C for script 1 D and E for script 2D and E for script 2 F and G for script 3F and G for script 3 H and I for script 4H and I for script 4

Script a, … script dScript a, … script d Actual scripts.Actual scripts. Select the part of Select the part of scriptscript

sheet that has data sheet that has data (A1:O41) and copy.(A1:O41) and copy.

Go to Go to script a script a sheetsheet Paste specialPaste special… and choose … and choose

ValueValue (so we don’t copy (so we don’t copy formulas, only results).formulas, only results).

Delete column B-D (item, Delete column B-D (item, cond, row), select rows 2-cond, row), select rows 2-41, hit 41, hit sortsort button, delete button, delete column A (sort), and row 1 column A (sort), and row 1 (labels)(labels)

Save as tab-delimited text.Save as tab-delimited text.

Page 13: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

The scripts are readyThe scripts are ready

So, we have the data that we’re So, we have the data that we’re going to use.going to use.

The next thing is to figure out how The next thing is to figure out how we’re going to test these.we’re going to test these.

The goal is to test reading time on The goal is to test reading time on each region of the sentence by each region of the sentence by presenting the sentence region by presenting the sentence region by region.region.

Page 14: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Thinking through the Thinking through the experimentexperiment

What do we want to have happen?What do we want to have happen? Display some instructionsDisplay some instructions Do some practice trialsDo some practice trials Display “practice is over” messageDisplay “practice is over” message Do some real trialsDo some real trials Display “thanks!”Display “thanks!”

The trials:The trials: Show fully obscured sentence, wait for a keyShow fully obscured sentence, wait for a key Reveal next word, wait for a key, until doneReveal next word, wait for a key, until done Ask question, wait for responseAsk question, wait for response Give sound feedback about correctnessGive sound feedback about correctness

Page 15: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

PsyScriptPsyScript

To do this, we’ll use PsyScript, an To do this, we’ll use PsyScript, an environment for creating psychology environment for creating psychology experiments on the Mac.experiments on the Mac.

(It’s basically the only freely available (It’s basically the only freely available software of this type that has promise software of this type that has promise for working in the future – if for working in the future – if PsyScope had not become PsyScope had not become commercial as E-Prime, we’d be commercial as E-Prime, we’d be learning that instead).learning that instead).

Page 16: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

AppleScriptAppleScript The underlying machinery behind The underlying machinery behind

PsyScript is something called PsyScript is something called AppleScriptAppleScript.. This has been part of the Mac OS for about the This has been part of the Mac OS for about the

past 10 years, although it is gaining power and past 10 years, although it is gaining power and popularity recently.popularity recently.

AppleScript is a means by which you can AppleScript is a means by which you can tell other programs what to do.tell other programs what to do. For example, tell Internet Explorer to go to a For example, tell Internet Explorer to go to a

particular web page, tell Word to create a new particular web page, tell Word to create a new document and type the date, …document and type the date, …

Until you have an actual need for this, it Until you have an actual need for this, it doesn’t seem very exciting…doesn’t seem very exciting…

Page 17: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

AppleScriptAppleScript

AppleScript is a sophisticated high-level AppleScript is a sophisticated high-level programming language designed to be programming language designed to be human readable (and kind of human human readable (and kind of human writable). It’s supposed to look a lot like writable). It’s supposed to look a lot like English.English.

PsyScript itself is an application that can be PsyScript itself is an application that can be bossed around by AppleScript, and has the bossed around by AppleScript, and has the features that are useful in psycholinguistic features that are useful in psycholinguistic experiments, such as timing, drawing, experiments, such as timing, drawing, input, data recording functions.input, data recording functions.

Page 18: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Getting startedGetting started

To write (and use) AppleScript, we To write (and use) AppleScript, we use use Script EditorScript Editor..

Easiest way to do this: Find the Easiest way to do this: Find the end end experiment experiment script and double-click on script and double-click on it.it.tell application “PsyScript”tell application “PsyScript”

end experimentend experiment

end tellend tell

Page 19: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Note about PsyScriptNote about PsyScript

PsyScript runs faster from the Script EditorPsyScript runs faster from the Script Editor If you run PsyScript from the Script Editor you If you run PsyScript from the Script Editor you

have to manually tell it where your script is.have to manually tell it where your script is. To do this, find the line that says To do this, find the line that says tell fileHelper to tell fileHelper to

setContainer setContainer and change the thing in parentheses and change the thing in parentheses to what you see when you Command-click on the to what you see when you Command-click on the name of the script in the title bar of the Script name of the script in the title bar of the Script Editor Window, bottom to top, each separated by : Editor Window, bottom to top, each separated by : and not including the actual name of the script. and not including the actual name of the script. E.g.,E.g.,

setContainer(“Station 5:Desktop Folder:PsyScript:”)setContainer(“Station 5:Desktop Folder:PsyScript:”)

Page 20: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

MovingwindowMovingwindow I wrote a script called I wrote a script called movingwindow movingwindow to to

do what we’re going to do today.do what we’re going to do today. The stimuli and instructions files are in a The stimuli and instructions files are in a

folder called “resources” in the same folder as folder called “resources” in the same folder as the script is. The names of these files are set the script is. The names of these files are set at the top of the script, in mine, they are:at the top of the script, in mine, they are:

Mwstimuli.txt : sentence list as exported from Excel Mwstimuli.txt : sentence list as exported from Excel (tab-delimited text, exporting e.g., (tab-delimited text, exporting e.g., script ascript a))

Mwpractice.txt : sentence list for the practice itemsMwpractice.txt : sentence list for the practice items Mwinstruc.txt : initial instructionsMwinstruc.txt : initial instructions Mwready.txt : post-practice instructionsMwready.txt : post-practice instructions Mwthanks.txt : end of experiment debriefing.Mwthanks.txt : end of experiment debriefing.

Results are stored in “results” folder.Results are stored in “results” folder.

Page 21: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics

Sentence listsSentence lists

To generate the sentence lists in the right To generate the sentence lists in the right format for format for movingwindowmovingwindow, go to one of the , go to one of the script a-d pages, do Save As… from Excel, script a-d pages, do Save As… from Excel, and choose tab-delimited text.and choose tab-delimited text. Columns should be code, question, answer, Columns should be code, question, answer,

sentence (in eight columns)sentence (in eight columns) The end results will come out in a file that The end results will come out in a file that

you can load back into Excel (a tab-you can load back into Excel (a tab-delimited file):delimited file): Columns are: code, region number, time for Columns are: code, region number, time for

region, correct answer 1/0, text of regionregion, correct answer 1/0, text of region

Page 22: Week 5. Experiments with PsyScript GRS LX 865 Topics in Linguistics