thunlp / EntityDuetNeuralRanking

Entity-Duet Neural Ranking Model
MIT License
153 stars 20 forks source link

what is "car_emb" the meaning in EDRM/KNRM.py #2

Closed KobeDeShow closed 6 years ago

KobeDeShow commented 6 years ago

hi EdwardZH , what is "car_emb" the meaning in EDRM/KNRM.py, type embedding?

EdwardZH commented 6 years ago

Yes. It means type embedding.

KobeDeShow commented 6 years ago

thanks for your reply! Here are some of my understanding of variables in EDRM/DataLoader.py 1, open(inst_file).readline.split('\t'), the result like this -> if score > 0 ["q_word_id_1,q_word_id_2,...", "d_pos_word_id_1,d_pos_word_id_2,...", "d_neg_word_id_1,d_neg_word_id_2,...", "score", "q_entity_text_1,q_entity_text_2...", "d_pos_entity_text_1,d_pos_entity_text_2,...", "d_neg_entity_text_1,d_neg_entity_text_2,..."]

2, ent_wrd_dict = {ent_text:[type_id1, type_id2...]} 3, ent_des_dict = {ent_text:[des_word_id1, des_word_id2...]} 4, ent2idx = {ent_text: ent_id,...} am i right? by the way, what is self._ent_des meaning?

EdwardZH commented 6 years ago

You are right. self._ent_des is a list of entity description and you can map description and entity through ent_des_dict. ent_des_dict = {ent_text:id_in_self._ent_des}. Through this method, we can have only one copy in memory. On the other hand, you can also achieve your own data loader.