|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread eu.semaine.components.Component eu.semaine.components.dialogue.actionproposers.UtteranceActionProposer
public class UtteranceActionProposer
The UtteranceActionProposer determines what to say based on the current context. TODO: uitbreiden, precieze werking beschrijven in details Input AgentStateReceiver('emaine.data.state.agent') --> take/release turn messages UserStateReceiver('semaine.data.state.user.behaviour') --> user speaking state and detected emotions XMLReceiver('semaine.data.state.context') --> For context information such as user present and the current character Output FMLSender('semaine.data.action.candidate.function') --> utterances to the output modules DialogStateSender('semaine.data.state.dialog') --> dialog state (speaker & listener) XMLSender('semaine.data.state.context') --> For context information such as user present and the current character
Nested Class Summary |
---|
Nested classes/interfaces inherited from class eu.semaine.components.Component |
---|
Component.State |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
int |
agentSpeakingState
|
static int |
CHANGE_ASKED
|
static int |
CHAR_ASKED
|
static int |
CHAR_ASKED_2
|
static int |
CHAR_SUGGESTED
|
static int |
CHAR_SUGGESTED_2
|
int |
charChangeState
|
int |
charStartupState
|
static float |
HIGH_AROUSAL
|
static int |
HOW_ARE_YOU_ASKED
|
static int |
INTRODUCED
|
static int |
LISTENING
|
static float |
LOW_AROUSAL
|
static int |
NEUTRAL
|
static int |
OBADIAH
|
static int |
POPPY
|
static int |
PREPARING_TO_SPEAK
|
static int |
PRUDENCE
|
static long |
SMALL_UTTERANCE
|
static int |
SPEAKING
|
static int |
SPIKE
|
int |
suggestedChar
|
static int |
WAITING
|
Fields inherited from class eu.semaine.components.Component |
---|
inputWaiting, isInput, isOutput, log, meta, receivers, senders, state, waitingTime |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
UtteranceActionProposer()
Constructor of UtteranceActionProposer Initializes the senders and receivers, randomly determines the first character and initializes some data |
Method Summary | |
---|---|
void |
act()
TODO: Herschrijven |
void |
adaptQualityToHistory(java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> utterances)
|
void |
addDetectedDActs(StateInfo stateInfo)
Reads the received Message and tries to filter out the detected Dialogue Acts. |
void |
addDetectedEmotions(StateInfo userInfo)
Reads the received Message and tries to filter out the detected Emotion Events. |
boolean |
agentShouldSpeak(SEMAINEMessage m)
Reads the messages from the TurnTakingInterpreter and decides if the agent should start speaking or not. |
java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> |
convertToSpokenUtterances(java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentUtterance> uttrs)
|
eu.semaine.components.dialogue.datastructures.AgentUtterance |
findAgentUtterance(java.lang.String utterance,
java.lang.String newType)
|
eu.semaine.components.dialogue.datastructures.DialogueAct |
getCombinedUserDialogueAct()
Combines the detected Dialogue Acts of the previous user turn into 1 DialogueAct |
java.lang.String |
getMaxScorer(java.util.HashMap<java.lang.String,java.lang.Integer> scores)
Returns the best possible utterance from the given map with responses and scores Only returns utterances with a score higher than 0. |
eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance |
getMaxUtterance(java.util.HashMap<java.lang.String,java.lang.Integer> scores,
java.lang.String type)
|
eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance |
getResponse()
Determines what to say based on the context Calls different suggestion-methods which return a set of suggestions, with for each suggestion a certain quality. |
java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> |
getUtterancesFromCategory(java.lang.String category,
double quality)
Based on the given type of sentence this method tries to find an utterance of that type that hasn't been said for the last x agent utterances. |
boolean |
giveIntro()
|
java.util.HashMap<java.lang.String,java.lang.Integer> |
giveResponseRatings(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Returns a map with all possible responses plus the ratings of those responses (based on the response model) |
void |
initData()
Initializes the utterances of the characters, the character names, and the character history |
eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance |
manageAgentStart()
Manages the agent startup process If the user is in this process it will determine what the next step in the process is and return an AgentUtterance to speak. |
eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance |
manageCharChange()
Manages the character change process. |
eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance |
pickUtterances(java.lang.String type)
Based on the given type of sentence this method tries to find an utterance of that type that hasn't been said for the last x agent utterances. |
void |
processUtteranceEnd()
Called when the output module messages that the utterance is finished. |
void |
react(SEMAINEMessage m)
Sets context variables if updates are received. |
void |
sendConvState()
Sends around that the agent is silent |
void |
sendListening()
Sends around that the agent is silent |
void |
sendNewCharacter(int character)
Sends around that the system has changed to a new character |
void |
sendSpeaking()
Sends around that the agent is speaking |
java.lang.String |
sendUtterance(eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance utterance)
Sends the given utterance to the output modules. |
void |
setUserSpeakingState(StateInfo userInfo)
Reads the received Message and tries to filter out the detected user speaking state. |
boolean |
speechReady(SEMAINEXMLMessage xm)
This method checks if the given message contains the end signal of the animation that the agent is playing. |
boolean |
speechStarted(SEMAINEXMLMessage xm)
This method checks if the given message contains the start signal of the animation that the agent is going to play next. |
java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> |
suggestAfterSilence()
Returns a list of possible responses based on the fact that a user did not start speaking after the agent's turn. |
java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> |
suggestLastOptions(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Returns a list of generic responses with a very low quality. |
java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> |
suggestLinkingSentence(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Returns a list of possible linking utterances based on the previous agent utterance and the user's response. |
java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> |
suggestOnArousal()
Returns a list of possible responses based on the arousal. |
java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> |
suggestOnContentFeatures(eu.semaine.components.dialogue.datastructures.DialogueAct act)
Returns a list of possible responses based on the detected Content Features in the given DialogueAct |
void |
updateCharacterAndUser(StateInfo stateInfo)
Checks the StateInfo for updates about user presence and character changes. |
void |
userAppeared()
Called when a user is detected in the screen. |
void |
userDisappeared()
Called when the user disappears from the screen |
java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentUtterance> |
utteranceCopy(java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentUtterance> utterances)
Makes a deepcopy of the given ArrayList |
Methods inherited from class eu.semaine.components.Component |
---|
customStartIO, exitRequested, messageAvailableFrom, requestExit, run |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int WAITING
public static final int LISTENING
public static final int PREPARING_TO_SPEAK
public static final int SPEAKING
public static final int POPPY
public static final int PRUDENCE
public static final int SPIKE
public static final int OBADIAH
public static final int NEUTRAL
public static final int CHANGE_ASKED
public static final int CHAR_SUGGESTED
public static final int CHAR_ASKED
public static final int CHAR_SUGGESTED_2
public static final int CHAR_ASKED_2
public static final int INTRODUCED
public static final int HOW_ARE_YOU_ASKED
public static final float HIGH_AROUSAL
public static final float LOW_AROUSAL
public static final long SMALL_UTTERANCE
public int agentSpeakingState
public int charChangeState
public int charStartupState
public int suggestedChar
Constructor Detail |
---|
public UtteranceActionProposer() throws javax.jms.JMSException
javax.jms.JMSException
Method Detail |
---|
public void initData()
public void act() throws javax.jms.JMSException
act
in class Component
javax.jms.JMSException
- if communication with the JMS server goes wrong.public void react(SEMAINEMessage m) throws javax.jms.JMSException
react
in class Component
javax.jms.JMSException
- if communication with the JMS server goes wrong.public boolean speechReady(SEMAINEXMLMessage xm) throws javax.jms.JMSException
xm
- the message to check
javax.jms.JMSException
public boolean speechStarted(SEMAINEXMLMessage xm)
xm
- the message to check
public void updateCharacterAndUser(StateInfo stateInfo) throws javax.jms.JMSException
stateInfo
-
javax.jms.JMSException
public void userAppeared() throws javax.jms.JMSException
javax.jms.JMSException
public boolean giveIntro() throws javax.jms.JMSException
javax.jms.JMSException
public void userDisappeared() throws javax.jms.JMSException
javax.jms.JMSException
public eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance manageCharChange() throws javax.jms.JMSException
javax.jms.JMSException
public eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance manageAgentStart()
public boolean agentShouldSpeak(SEMAINEMessage m)
m
- - the received message
public eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance getResponse()
public java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> suggestAfterSilence()
public java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> suggestLinkingSentence(eu.semaine.components.dialogue.datastructures.DialogueAct act)
act
- the DialogueAct of the user's previous turn
public java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> suggestOnContentFeatures(eu.semaine.components.dialogue.datastructures.DialogueAct act)
act
- the DialogueAct of the user's previous turn
public java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> suggestOnArousal()
act
- the DialogueAct of the user's previous turn
public java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> suggestLastOptions(eu.semaine.components.dialogue.datastructures.DialogueAct act)
act
- the DialogueAct of the user's previous turn
public java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> getUtterancesFromCategory(java.lang.String category, double quality)
type
- - the type of the utterance
public java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> convertToSpokenUtterances(java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentUtterance> uttrs)
public void adaptQualityToHistory(java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance> utterances)
public eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance pickUtterances(java.lang.String type)
type
- - the type of the utterance
public eu.semaine.components.dialogue.datastructures.AgentUtterance findAgentUtterance(java.lang.String utterance, java.lang.String newType)
public void processUtteranceEnd() throws javax.jms.JMSException
javax.jms.JMSException
public java.lang.String sendUtterance(eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance utterance) throws javax.jms.JMSException
utterance
-
javax.jms.JMSException
public void sendSpeaking() throws javax.jms.JMSException
javax.jms.JMSException
public void sendListening() throws javax.jms.JMSException
javax.jms.JMSException
public void sendConvState() throws javax.jms.JMSException
javax.jms.JMSException
public void sendNewCharacter(int character) throws javax.jms.JMSException
character
- the new character
javax.jms.JMSException
public void setUserSpeakingState(StateInfo userInfo)
m
- - the received messagepublic void addDetectedEmotions(StateInfo userInfo)
m
- public void addDetectedDActs(StateInfo stateInfo) throws javax.jms.JMSException
m
-
javax.jms.JMSException
public java.util.HashMap<java.lang.String,java.lang.Integer> giveResponseRatings(eu.semaine.components.dialogue.datastructures.DialogueAct act)
act
-
public java.lang.String getMaxScorer(java.util.HashMap<java.lang.String,java.lang.Integer> scores)
scores
-
public eu.semaine.components.dialogue.datastructures.AgentSpokenUtterance getMaxUtterance(java.util.HashMap<java.lang.String,java.lang.Integer> scores, java.lang.String type)
public java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentUtterance> utteranceCopy(java.util.ArrayList<eu.semaine.components.dialogue.datastructures.AgentUtterance> utterances)
utterances
- - the list to copy
public eu.semaine.components.dialogue.datastructures.DialogueAct getCombinedUserDialogueAct()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |