Description Usage Arguments Details Value Examples
View source: R/AllUtterancesAndObjects.R
This function determines maps the valid utterances to the corresponding objects in the scene.
It then determines the probability of choosing an object based on the valid utterances in the scene.
1 2 3 4 5 6 | determineUttToObjectProbs(
validUtterances,
currentObjects,
mapObjToUtt,
notObeyInst
)
|
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 |
A vector of three values in range The target is the first object in the vector |
mapObjToUtt |
A 3x3 matrix. Values in the matrix are in range rows: The current objects in the scene columns: Features of the objects |
notObeyInst |
Determines the extent to which the instruction of the speaker is obeyed by the listener. (0 = full obedience, infinity = full instruction ignorance). Example: 0: Listener always picks red objects following the utterance "red". infinity: Listener as likely to pick green, blue or red objects even if the utterance is "red". |
This function is only used in X9
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | determineUttToObjectProbs(validUtterances, currentObjects, mappedObjToUtt, notObeyInst)
output:
[,1] [,2] [,3]
[1,] 1.00 0.00 0.00
[2,] 0.00 1.00 0.00
[3,] 0.00 0.00 1.00
[4,] 0.33 0.33 0.33
[5,] 0.33 0.33 0.33
Example:
To see which objects are present in the scene run:
allObjects[currentObjects,]
output:
shape pattern color
[1,] "cloud" "solid" "blue"
[2,] "circle" "solid" "blue"
[3,] "square" "solid" "blue"
The columns correspond to the three objects in the scene:
A solid blue cloud, a solid blue circle and a solid blue square.
If the utterance is circle the probability of choosing circle is 1,
while the probability for the cloud and the square is 0.
If the utterance is blue the probability of choosing the cloud,
the circle or the square is 1/3, since all three objects are blue.
The same goes for the utterance solid.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.