Skip to content

Commit

Permalink
Remove NLG
Browse files Browse the repository at this point in the history
  • Loading branch information
MalvinaNikandrou committed Dec 5, 2023
1 parent 3eb49c4 commit b2bfbd5
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 1,526 deletions.
44 changes: 0 additions & 44 deletions scripts/format_feedback_rules_csv.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/emma_experience_hub/api/controllers/simbot/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def handle_request_from_simbot_arena(self, request: SimBotRequest) -> SimBotResp
session = self.extract_intent_from_environment_feedback(session)
session = self.decide_what_the_agent_should_do(session)
session = self.generate_interaction_action_if_needed(session)
session = self.generate_language_action_if_needed(session)
self._upload_session_turn_to_database(session)

return session.current_turn.convert_to_simbot_response()
Expand Down Expand Up @@ -186,15 +185,6 @@ def generate_interaction_action_if_needed(self, session: SimBotSession) -> SimBo
logger.info(f"[ACTION] Interaction: `{session.current_turn.actions.interaction}`")
return session

def generate_language_action_if_needed(self, session: SimBotSession) -> SimBotSession:
"""Generate a language action if needed."""
logger.debug("Generating utterance for the turn (if needed)...")

session.current_turn.actions.dialog = self.pipelines.agent_language_generator.run(session)

logger.info(f"[ACTION] Dialog: `{session.current_turn.actions.dialog}`")
return session

def _upload_session_turn_to_database(self, session: SimBotSession) -> None:
"""Upload the current session turn to the database."""
self.clients.session_db.add_session_turn(session.current_turn)
Expand Down
5 changes: 0 additions & 5 deletions src/emma_experience_hub/api/controllers/simbot/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from emma_experience_hub.pipelines.simbot import (
SimBotAgentActionGenerationPipeline,
SimBotAgentIntentSelectionPipeline,
SimBotAgentLanguageGenerationPipeline,
SimBotEnvironmentErrorCatchingPipeline,
SimBotEnvironmentIntentExtractionPipeline,
SimBotFindObjectPipeline,
Expand All @@ -28,7 +27,6 @@ class SimBotControllerPipelines(BaseModel, arbitrary_types_allowed=True):
environment_intent_extractor: SimBotEnvironmentIntentExtractionPipeline
agent_intent_selector: SimBotAgentIntentSelectionPipeline
agent_action_generator: SimBotAgentActionGenerationPipeline
agent_language_generator: SimBotAgentLanguageGenerationPipeline
find_object: SimBotFindObjectPipeline

@classmethod
Expand Down Expand Up @@ -80,7 +78,4 @@ def from_clients(
previous_action_parser=SimBotPreviousActionParser(),
find_object_pipeline=find_object,
),
agent_language_generator=SimBotAgentLanguageGenerationPipeline(
prevent_default_response_as_lightweight=simbot_settings.feature_flags.prevent_default_response_as_lightweight
),
)
10 changes: 0 additions & 10 deletions src/emma_experience_hub/constants/simbot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import json
from collections.abc import Mapping
from csv import DictReader
from functools import lru_cache
from pathlib import Path
from types import MappingProxyType
Expand Down Expand Up @@ -78,15 +77,6 @@ def get_simbot_room_name_map() -> dict[str, str]:
return {room_name.lower(): room_name for room_name in get_simbot_room_names()}


@lru_cache(maxsize=1)
def get_feedback_rules() -> list[dict[str, str]]:
"""Load the feedback rules and responses from their file."""
csv_path = constants_absolute_path.joinpath("simbot", "feedback_rules.csv")
with open(csv_path, encoding="utf-8-sig") as csv_file:
raw_rule_reader = DictReader(csv_file)
return [{**rule, "id": str(idx)} for idx, rule in enumerate(raw_rule_reader, 2)]


@lru_cache(maxsize=1)
def get_search_budget() -> dict[str, SimBotRoomSearchBudget]:
"""Load the search_budget per room from file."""
Expand Down
Loading

0 comments on commit b2bfbd5

Please sign in to comment.