Skip to content

Commit

Permalink
fixes for pr
Browse files Browse the repository at this point in the history
  • Loading branch information
moon-strider committed Dec 25, 2023
1 parent 9656c40 commit a88a0be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions annotators/speech_function_classifier/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

def check_sfs(predicted_sf, previous_sf, current_speaker, previous_speaker):
if predicted_sf == "Command":
if ("Open" in previous_sf or previous_sf is "") and current_speaker == previous_speaker:
if ("Open" in previous_sf or previous_sf == "") and current_speaker == previous_speaker:
return "Open.Command"
elif current_speaker == previous_speaker:
return "Sustain.Continue.Command"
else:
return "React.Respond.Command"
elif predicted_sf == "Engage":
if previous_sf is "":
if previous_sf == "":
return "Open.Attend"
else:
return "React.Respond.Support.Engage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def select_response(dialog_context: List[str], hypotheses: List[dict], last_huma
human_entities = get_entities(last_human_ann_uttr, only_named=False, with_labels=False)

_human_is_switch_topic_request = is_switch_topic(last_human_ann_uttr)
_human_is_any_question = is_any_question_sentence_in_utterance(last_human_ann_uttr)
# _human_is_any_question = is_any_question_sentence_in_utterance(last_human_ann_uttr)
# if user utterance contains any question AND requires some intent by socialbot
_human_wants_to_chat_about_topic = (
if_chat_about_particular_topic(last_human_ann_uttr) and "about it" not in last_human_ann_uttr["text"].lower()
Expand All @@ -123,7 +123,7 @@ def select_response(dialog_context: List[str], hypotheses: List[dict], last_huma
speech_predictor_hyps = [v["prediction"] for v in speech_predictor]
speech_predictor_scores = [v["confidence"] for v in speech_predictor]
except TypeError:
logger.error(f"Warning! The speech_predictor_classifier data is either empty or corrupt.")
logger.error("Warning! The speech_predictor_classifier data is either empty or corrupt.")
return
try:
speech_index = speech_predictor_hyps.index(speech_annotation)
Expand Down

0 comments on commit a88a0be

Please sign in to comment.