Skip to content

Commit

Permalink
Remove utterance verification
Browse files Browse the repository at this point in the history
  • Loading branch information
MalvinaNikandrou committed Dec 5, 2023
1 parent 00f4653 commit 0a64b47
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 59 deletions.
7 changes: 0 additions & 7 deletions src/emma_experience_hub/api/controllers/simbot/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ def load_session_from_request(self, simbot_request: SimBotRequest) -> SimBotSess

session = self.pipelines.request_processing.run(simbot_request)

# Verify user utterance is valid
if self.settings.is_not_offline_evaluation and simbot_request.speech_recognition:
user_intent = self.pipelines.user_utterance_verifier.run(
simbot_request.speech_recognition
)
session.current_turn.intent.user = user_intent

# Cache the auxiliary metadata for the turn
self.clients.features.get_auxiliary_metadata(session.current_turn)

Expand Down
3 changes: 0 additions & 3 deletions src/emma_experience_hub/api/controllers/simbot/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
SimBotFindObjectPipeline,
SimBotRequestProcessingPipeline,
SimBotUserIntentExtractionPipeline,
SimBotUserUtteranceVerificationPipeline,
)


class SimBotControllerPipelines(BaseModel, arbitrary_types_allowed=True):
"""All the pipelines used by the SimBot Controller API."""

request_processing: SimBotRequestProcessingPipeline
user_utterance_verifier: SimBotUserUtteranceVerificationPipeline
user_intent_extractor: SimBotUserIntentExtractionPipeline
environment_intent_extractor: SimBotEnvironmentIntentExtractionPipeline
agent_intent_selector: SimBotAgentIntentSelectionPipeline
Expand Down Expand Up @@ -66,7 +64,6 @@ def from_clients(
request_processing=SimBotRequestProcessingPipeline(
session_db_client=clients.session_db,
),
user_utterance_verifier=SimBotUserUtteranceVerificationPipeline(),
user_intent_extractor=SimBotUserIntentExtractionPipeline(
qa_intent_client=clients.simbot_qa,
qa_intent_parser=SimBotQAOutputParser(
Expand Down
1 change: 0 additions & 1 deletion src/emma_experience_hub/datamodels/simbot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
SimBotDummyRawActions,
SimBotEnvironmentIntentType,
SimBotIntentType,
SimBotInvalidUtteranceIntentType,
SimBotNLUIntentType,
SimBotPhysicalInteractionIntentType,
SimBotUserIntentType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
SimBotAnyUserIntentType,
SimBotEnvironmentIntentType,
SimBotIntentType,
SimBotInvalidUtteranceIntentType,
SimBotNLUIntentType,
SimBotPhysicalInteractionIntentType,
SimBotUserIntentType,
Expand Down
12 changes: 3 additions & 9 deletions src/emma_experience_hub/datamodels/simbot/enums/intents.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ class SimBotIntentType(Enum):
search = "<search>"
act_previous = "<act><previous>"

# Improper instructions
empty_utterance = "<language><empty_utterance>"

# Clarification question triggers
act_no_match = "<act><no_match>"
act_too_many_matches = "<act><too_many_matches>"
Expand Down Expand Up @@ -152,9 +149,9 @@ def verbal_interaction_intent_triggers_search(self) -> bool:
@staticmethod
def is_invalid_utterance_intent_type( # noqa: WPS602
intent_type: SimBotIntentType,
) -> TypeGuard[SimBotInvalidUtteranceIntentType]:
"""Return True if the intent type matches `SimBotInvalidUtteranceIntentType`."""
return intent_type in SimBotInvalidUtteranceIntentType.__args__ # type: ignore[attr-defined]
) -> bool:
"""Assume user utterances are always valid."""
return False

@staticmethod
def is_user_intent_type( # noqa: WPS602
Expand Down Expand Up @@ -192,8 +189,6 @@ def is_user_qa_type( # noqa: WPS602
return intent_type in SimBotUserQAType.__args__ # type: ignore[attr-defined]


SimBotInvalidUtteranceIntentType = Literal[SimBotIntentType.empty_utterance,]

SimBotUserQAType = Literal[
SimBotIntentType.ask_about_game,
SimBotIntentType.ask_about_agent,
Expand Down Expand Up @@ -221,7 +216,6 @@ def is_user_qa_type( # noqa: WPS602

SimBotAnyUserIntentType = Literal[
SimBotUserIntentType,
SimBotInvalidUtteranceIntentType,
SimBotUserQAType,
]

Expand Down
3 changes: 0 additions & 3 deletions src/emma_experience_hub/pipelines/simbot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@
from emma_experience_hub.pipelines.simbot.user_intent_extraction import (
SimBotUserIntentExtractionPipeline,
)
from emma_experience_hub.pipelines.simbot.user_utterance_verification import (
SimBotUserUtteranceVerificationPipeline,
)

This file was deleted.

0 comments on commit 0a64b47

Please sign in to comment.