Skip to content

Commit

Permalink
Remove simbot qa
Browse files Browse the repository at this point in the history
  • Loading branch information
MalvinaNikandrou committed Dec 5, 2023
1 parent 2206bc5 commit 3eb49c4
Show file tree
Hide file tree
Showing 15 changed files with 3 additions and 520 deletions.
1 change: 0 additions & 1 deletion src/emma_experience_hub/api/clients/simbot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
from emma_experience_hub.api.clients.simbot.features import SimBotFeaturesClient
from emma_experience_hub.api.clients.simbot.nlu_intent import SimBotNLUIntentClient
from emma_experience_hub.api.clients.simbot.placeholder_vision import SimBotPlaceholderVisionClient
from emma_experience_hub.api.clients.simbot.qa_intent import SimBotQAIntentClient
from emma_experience_hub.api.clients.simbot.session_db import SimBotSessionDbClient
48 changes: 0 additions & 48 deletions src/emma_experience_hub/api/clients/simbot/qa_intent.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/emma_experience_hub/api/controllers/simbot/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
SimBotFeaturesClient,
SimBotNLUIntentClient,
SimBotPlaceholderVisionClient,
SimBotQAIntentClient,
SimBotSessionDbClient,
)
from emma_experience_hub.common.settings import SimBotSettings
Expand All @@ -35,7 +34,6 @@ class SimBotControllerClients(BaseModel, arbitrary_types_allowed=True):
action_predictor: SimbotActionPredictionClient
session_db: SimBotSessionDbClient
confirmation_response_classifier: ConfirmationResponseClassifierClient
simbot_qa: SimBotQAIntentClient

@classmethod
def from_simbot_settings(cls, simbot_settings: SimBotSettings) -> "SimBotControllerClients":
Expand Down Expand Up @@ -73,11 +71,6 @@ def from_simbot_settings(cls, simbot_settings: SimBotSettings) -> "SimBotControl
timeout=simbot_settings.client_timeout,
disable=not simbot_settings.feature_flags.enable_confirmation_questions,
),
simbot_qa=SimBotQAIntentClient(
endpoint=simbot_settings.simbot_qa_url,
timeout=simbot_settings.client_timeout,
disable=not simbot_settings.feature_flags.enable_simbot_qa,
),
)

def healthcheck(self, attempts: int = 1, interval: int = 0) -> bool:
Expand Down
10 changes: 0 additions & 10 deletions src/emma_experience_hub/api/controllers/simbot/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
SimBotActionPredictorOutputParser,
SimBotNLUOutputParser,
SimBotPreviousActionParser,
SimBotQAEntityParser,
SimBotQAOutputParser,
SimBotVisualGroundingOutputParser,
)
from emma_experience_hub.pipelines.simbot import (
Expand Down Expand Up @@ -55,21 +53,13 @@ def from_clients(
session_db_client=clients.session_db,
),
user_intent_extractor=SimBotUserIntentExtractionPipeline(
qa_intent_client=clients.simbot_qa,
qa_intent_parser=SimBotQAOutputParser(
enable_incomplete_utterances_intent=simbot_settings.feature_flags.enable_incomplete_utterances_intent
),
confirmation_response_classifier=clients.confirmation_response_classifier,
_enable_object_related_questions=simbot_settings.feature_flags.enable_object_related_questions_from_user,
_enable_simbot_qa=simbot_settings.feature_flags.enable_simbot_qa,
_enable_confirmation_questions=simbot_settings.feature_flags.enable_confirmation_questions,
_enable_clarification_questions=simbot_settings.feature_flags.enable_clarification_questions,
),
environment_intent_extractor=SimBotEnvironmentIntentExtractionPipeline(),
agent_intent_selector=SimBotAgentIntentSelectionPipeline(
features_client=clients.features,
simbot_qa_client=clients.simbot_qa,
simbot_qa_entity_parser=SimBotQAEntityParser(),
nlu_intent_client=clients.nlu_intent,
nlu_intent_parser=SimBotNLUOutputParser(
intent_type_delimiter=simbot_settings.nlu_predictor_intent_type_delimiter
Expand Down
6 changes: 0 additions & 6 deletions src/emma_experience_hub/common/settings/simbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ class SimBotFeatureFlags(BaseModel):
enable_confirmation_questions: bool = True
enable_grab_from_history: bool = True
enable_incomplete_utterances_intent: bool = True
enable_object_related_questions_from_user: bool = True
enable_rasa_high_level_planner: bool = False
enable_scanning_during_search: bool = True
enable_search_actions: bool = True
enable_search_after_missing_inventory: bool = True
enable_search_after_no_match: bool = True
enable_simbot_qa: bool = True

prevent_default_response_as_lightweight: bool = True

Expand All @@ -48,10 +46,8 @@ def set_offline_evaluation_flags(
values["enable_coreference_resolution"] = False
values["enable_confirmation_questions"] = False
values["enable_incomplete_utterances_intent"] = False
values["enable_object_related_questions_from_user"] = False
values["enable_scanning_during_search"] = False
values["enable_search_after_missing_inventory"] = False
values["enable_simbot_qa"] = False
values["prevent_default_response_as_lightweight"] = False

values["gfh_location_type"] = GFHLocationType.viewpoint
Expand Down Expand Up @@ -92,8 +88,6 @@ class SimBotSettings(BaseSettings):
url=f"{scheme}://0.0.0.0:5507", scheme=scheme
)

simbot_qa_url: AnyHttpUrl = AnyHttpUrl(url=f"{scheme}://0.0.0.0:5510", scheme=scheme)

placeholder_vision_url: AnyHttpUrl = AnyHttpUrl(url=f"{scheme}://0.0.0.0:5506", scheme=scheme)

class Config:
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 @@ -13,7 +13,6 @@
SimBotNLUIntentType,
SimBotPhysicalInteractionIntentType,
SimBotUserIntentType,
SimBotUserQAType,
SimBotVerbalInteractionIntentType,
)
from emma_experience_hub.datamodels.simbot.feedback import SimBotFeedbackRule, SimBotFeedbackState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
SimBotNLUIntentType,
SimBotPhysicalInteractionIntentType,
SimBotUserIntentType,
SimBotUserQAType,
SimBotVerbalInteractionIntentType,
)
60 changes: 1 addition & 59 deletions src/emma_experience_hub/datamodels/simbot/enums/intents.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ class SimBotIntentType(Enum):
confirm_yes = "<confirm><yes>"
confirm_no = "<confirm><no>"

# Utterances that require only verbal responses
ask_about_game = "<ask><about_game>"
ask_about_agent = "<ask><about_agent>"
ask_not_enough_information = "<not_enough_information>"
ask_about_affordance = "<ask><about_affordance>"
ask_about_appearance = "<ask><about_appearance>"
ask_about_location = "<ask><about_location>"
greeting = "<greeting>"
admiration = "<admiration>"
incomplete_utterance_find = "<incomplete_utterance_find>"
incomplete_utterance_goto = "<incomplete_utterance_goto>"
incomplete_utterance_pick = "<incomplete_utterance_pick>"
incomplete_utterance_place = "<incomplete_utterance_place>"

# Feedback for previous turn success
generic_success = "<success><generic>"

Expand Down Expand Up @@ -89,20 +75,6 @@ def is_environment_error(self) -> bool:
"""Return True if the intent is one of the Arena error types."""
return self.is_environment_intent_type(self)

@property
def is_user_qa(self) -> bool:
"""Return True if the intent is one of the QA types."""
return self.is_user_qa_type(self)

@property
def is_user_qa_about_object(self) -> bool:
"""Return True if the user is asking about an object."""
return self in {
SimBotIntentType.ask_about_affordance,
SimBotIntentType.ask_about_appearance,
SimBotIntentType.ask_about_location,
}

@property
def is_actionable(self) -> bool:
"""Return True if the intent is a type of instruction."""
Expand Down Expand Up @@ -181,43 +153,16 @@ def is_verbal_interaction_intent_type( # noqa: WPS602
"""Return True if the intent type matches `SimBotVerbalInteractionIntentType`."""
return intent_type in SimBotVerbalInteractionIntentType.__args__ # type: ignore[attr-defined]

@staticmethod
def is_user_qa_type( # noqa: WPS602
intent_type: SimBotIntentType,
) -> TypeGuard[SimBotUserQAType]:
"""Return True if the intent type matches `SimBotUserQAType`."""
return intent_type in SimBotUserQAType.__args__ # type: ignore[attr-defined]


SimBotUserQAType = Literal[
SimBotIntentType.ask_about_game,
SimBotIntentType.ask_about_agent,
SimBotIntentType.ask_about_affordance,
SimBotIntentType.ask_about_location,
SimBotIntentType.ask_about_appearance,
SimBotIntentType.ask_not_enough_information,
SimBotIntentType.greeting,
SimBotIntentType.admiration,
SimBotIntentType.incomplete_utterance_find,
SimBotIntentType.incomplete_utterance_goto,
SimBotIntentType.incomplete_utterance_pick,
SimBotIntentType.incomplete_utterance_place,
]


SimBotUserIntentType = Literal[
SimBotIntentType.clarify_answer,
SimBotIntentType.confirm_yes,
SimBotIntentType.confirm_no,
SimBotIntentType.act,
SimBotUserQAType,
]


SimBotAnyUserIntentType = Literal[
SimBotUserIntentType,
SimBotUserQAType,
]
SimBotAnyUserIntentType = Literal[SimBotUserIntentType,]

SimBotEnvironmentIntentType = Literal[
SimBotIntentType.unsupported_action,
Expand Down Expand Up @@ -259,9 +204,6 @@ def is_user_qa_type( # noqa: WPS602
SimBotIntentType.act_too_many_matches,
SimBotIntentType.act_missing_inventory,
SimBotIntentType.generic_success,
SimBotIntentType.ask_about_affordance,
SimBotIntentType.ask_about_location,
SimBotIntentType.ask_about_appearance,
]

SimBotNLUIntentType = Literal[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@
from emma_experience_hub.functions.simbot.agent_intent_selection.instruction_handler import (
SimBotActHandler,
)
from emma_experience_hub.functions.simbot.agent_intent_selection.object_qa_handler import (
SimBotObjectQAHandler,
)

This file was deleted.

Loading

0 comments on commit 3eb49c4

Please sign in to comment.