Description Usage Arguments Value Examples
Full-RSA
Determines the probability of the listener choosing a certain object given the speaker's utterance and her own object preferences.
P(obj | utt, listener's object preferences).
It essentially infers which object it should pick under a certain literal listener preference.
1 2 3 4 5 6 7 8 | pragmaticListener(
utterance,
listenerObjectPreferences,
validUtterances,
currentObjects,
uttToObjProbs,
alpha
)
|
utterance |
The uttered word by the speaker that the listener hears. An index referring to one of the values in the vector validUtterances. |
listenerObjectPreferences |
One of the rows of the list of preference priors for all valid utterances based on the object in the scene. The list has as many rows as the length of the validUtterances vector + 1. Each row in the list contains a vector of length 3, as there are three objects in the scene. The extra row is for the case of no feature preferences whatsoever, i.e. uniform prior over all three objects in the scene. |
validUtterances |
A vector of utterances that correspond to all feature values present in the current objects in the scene. For example, it only makes sense to utter "red" in a scene if there are red objects present. |
currentObjects |
Vector of three values in The target is the first object in the vector |
uttToObjProbs |
A matrix. The rows map each possible utterance that corresponds to each present feature value of the current objects. The columns represent the three objects in the scene. This reflects the obedience-parameter and which objects match the respective utterance. The matrix shows the probability that a certain object is chosen following a certain utterance, that is valid in the scene. The number of rows of the matrix match the length of the validUtterances vector. |
alpha |
A parameter between 0 and 1. Exponential scaling of the speaker choosing the utterance that maximizes the chance of the listener getting the target object right. |
A vector of the normalized probability of the listener choosing a certain object given the speaker's utterance and her own object preferences.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | listenerObjectPreferences <- objectPreferenceSoftPriors[[2]]
pragmaticListener(utterance, listenerObjectPreferences,
validUtterances, currentObjects, uttToObjProbs, alpha)
output:
[1] 1 0 0
To see which object are in the object constellation run:
allObjects[currentObjects,]
output:
[,1] [,2] [,3]
[1,] "cloud" "solid" "blue"
[2,] "circle" "solid" "blue"
[3,] "square" "solid" "blue"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.