Пример #1
0
    def __create_response_for_what_to_V(df):
        df_after_what_to = df.loc[Nlp_util.get_idx_list_of_idiom_list(
            ["what to", "how to"], df["base_form"])[0] + 2:, :]

        words_after_what_to = WordFormatter.Df2Str(df_after_what_to)

        cmp = [
            ["it must be not easy to find how to" + words_after_what_to],
            ["now you are looking for the way to" + words_after_what_to],
            ["should be not that easy to find how to" + words_after_what_to],
        ]

        encourage = [
            [
                "but i am sure that thinking about it and speaking out it helps you🤗"
            ],
            [
                "eventho its always tough to find the right way, you try to figure it out. Thats impressing me😊"
            ],
            [
                "plz let me know any idea comes to your mind now. it might help you figuring it out☺️"
            ],
            [
                "tell me if you have any little idea. It could help you finding ur way😊"
            ],
        ]

        random_idx_for_cmp = randint(0, len(cmp) - 1)
        random_idx_for_encourage = randint(0, len(encourage) - 1)

        return cmp[random_idx_for_cmp] + encourage[random_idx_for_encourage]
Пример #2
0
 def __does_user_feel_useless(df):
     idx_list_of_useless = Nlp_util.get_idx_list_of_idiom_list(
         ["be useless", "feel useless"], df["base_form"])
     if len(idx_list_of_useless) == 0:
         return False
     else:
         for useless_idx in idx_list_of_useless:
             is_subj_i = Df_util.anything_isin(["i"], df.loc[:useless_idx,
                                                             "word"])
             if is_subj_i:
                 return True
         return False