chatbot.common package

Submodules

chatbot.common.chat_conf_manager module

class chatbot.common.chat_conf_manager.ChatBotConfManager(cb_id)[source]

Bases: object

class which handle chabot conf include nlp, stroyboard, entity and service (1) on prepare time : set confs for chat bot (2) on run time : get confs from db and provide getter for essential values

get_entity_list()[source]

get entity list to use :param data: :return:

get_intent_model()[source]

tag type mecab, twitter, etc :param data: :return:

get_model_conf(cb_id, purpose)[source]
get_ner_model()[source]

net id pretrained on hoyai :param data: :return:

get_pattern_intent_model()[source]

tag type mecab, twitter, etc :param data: :return:

get_pos_type()[source]

tag type mecab, twitter, etc :param data: :return:

get_resp_model()[source]

net id pretrained on hoyai :param data: :return:

get_story_board()[source]

net id pretrained on hoyai :param data: :return:

get_ton_model()[source]

net id pretrained on hoyai :param data: :return:

get_word_embed_model()[source]

get word embed model (w2v.. ) :param data: :return:

set_entity_list(data)[source]

set entity list to use :param data: :return:

set_ner_model(data)[source]

net id pretrained on hoyai :param data: :return:

set_pos_type(data)[source]

tag type mecab, twitter, etc :param data: :return:

set_resp_model(data)[source]

net id pretrained on hoyai :param data: :return:

set_story_board(data)[source]

net id pretrained on hoyai :param data: :return:

set_ton_model(data)[source]

net id pretrained on hoyai :param data: :return:

set_word_embed_model(data)[source]

set word embed model (w2v.. ) :param data: :return:

chatbot.common.chat_knowledge_data_dict module

class chatbot.common.chat_knowledge_data_dict.ChatKnowledgeDataDict(cb_id)[source]

Bases: object

check_conf(cb_id)[source]

check if data is already loaded :return: boolean

check_dict(cb_id)[source]

check if data is already loaded :return: boolean

check_ngram(cb_id)[source]

check if data is already loaded :return: boolean

check_synonym(cb_id)[source]

check if data is already loaded :return: boolean

get_entity()[source]
get_entity_extra(intent_id)[source]
get_entity_key(intent_id)[source]
get_intent_conf(type)[source]
initialize(cb_id)[source]

initialize ChatKnowlodgeMemdict Class :return: none

chatbot.common.chat_knowledge_mem_dict module

class chatbot.common.chat_knowledge_mem_dict.ChatKnowledgeMemDict[source]

Bases: object

class for storing dict data on the django memory for speed up dict search action

conf = {}
data = {}
data_conf = {}
data_order = {}
ngram = {}
ngram_conf = {}
ngram_order = {}
synonym = {}

chatbot.common.chat_share_data module

class chatbot.common.chat_share_data.ShareData[source]

Bases: chatbot.common.chat_conf_manager.ChatBotConfManager

share data class is data component which includes json2object and object2json maethod the purpose of this class is mainly on keep conversation data on thread beacuse this api works on rest api we need some info like cookie that where we were on the last convrsation

add_extra_client_data()[source]

add extra data for client :return:

add_test_client_data()[source]

add unchanged info for client test :return:

convert_to_list_shape(input)[source]

convert dict to list-dict (client developer request) :param input: :return:

get_chatbot_id()[source]
Parameters:data
Returns:
get_convert_data()[source]

intent id :param intent_id: :return:

get_convert_dict_data()[source]
Parameters:data
Returns:
get_edit_history()[source]

intent id :param intent_id: :return:

get_input_data()[source]
Parameters:data
Returns:
get_intent_history()[source]

intent id :param intent_id: :return:

get_intent_id()[source]
Parameters:data
Returns:
get_morphed_data()[source]
Parameters:data
Returns:
get_output_data()[source]

intent id :param intent_id: :return:

get_pattern_intent_id()[source]
Parameters:data
Returns:
get_request_data()[source]

intent id :param intent_id: :return:

get_request_type()[source]

manage request type :param data: :return:

get_service_type()[source]
Parameters:data
Returns:
get_story_id()[source]
Parameters:data
Returns:
get_story_key_entity()[source]
Parameters:data
Returns:
get_story_ner_entity()[source]

manage result of ner(bilstmcrf algoritm) result :param data: :return:

get_story_slot_entity(key=None)[source]
Parameters:data
Returns:
initialize_story()[source]
initialize_story_entity()[source]
load_json(object)[source]

load josn object to data object :param object: :return:

merge_share_data(output_share_data)[source]

simply update all info on this class to output_share_data :param input_share_data: :return:

replace_story_ner_entity(obj)[source]

manage result of ner(bilstmcrf algoritm) result :param data: :return:

replace_story_slot_entity(obj)[source]

manage result of ner(bilstmcrf algoritm) result :param data: :return:

set_chatbot_id(data)[source]
Parameters:data
Returns:
set_convert_data(data)[source]

intent id :param intent_id: :return:

set_convert_dict_data(data)[source]
Parameters:data
Returns:
set_edit_history(edit_type)[source]

intent id :param intent_id: :return:

set_input_data(data)[source]
Parameters:data
Returns:
set_intent_history(intent_id)[source]

intent id :param intent_id: :return:

set_intent_id(data)[source]
Parameters:data
Returns:
set_morphed_data(data)[source]
Parameters:data
Returns:
set_output_data(data)[source]

intent id :param intent_id: :return:

set_pattern_intent_id(data)[source]
Parameters:data
Returns:
set_request_data(data)[source]

intent id :param intent_id: :return:

set_request_type(data)[source]

manage request type :param data: :return:

set_service_type(data)[source]
Parameters:data
Returns:
set_story_id(data)[source]
Parameters:data
Returns:
set_story_key_entity(data)[source]
Parameters:data
Returns:
set_story_ner_entity(key, val)[source]

manage result of ner(bilstmcrf algoritm) result :param data: :return:

set_story_slot_entity(key, val)[source]
Parameters:data
Returns:
to_json()[source]

convert data object to json :return:

update_story_slot_entity(key, val)[source]
Parameters:data
Returns:

chatbot.common.chat_story_conf_data module

class chatbot.common.chat_story_conf_data.ChatStoryConfData(intent_id)[source]

Bases: object

get_intent_story()[source]
get_story_response(story_id)[source]
get_story_service(story_id)[source]

Module contents