From 9a3f5f7a690ef56893e05ec62dff36adab155d97 Mon Sep 17 00:00:00 2001 From: KenelmQLH <1097824882@qq.com> Date: Sat, 13 Jan 2024 14:33:00 +0800 Subject: [PATCH] Update change.txt --- CHANGE.txt | 6 ++++++ EduNLP/ModelZoo/quesnet/quesnet.py | 1 + EduNLP/Pretrain/quesnet_vec.py | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGE.txt b/CHANGE.txt index 17e33497..cf09733d 100644 --- a/CHANGE.txt +++ b/CHANGE.txt @@ -1,3 +1,9 @@ +v1.0.0 + 1. Support cuda for I2V and T2V. + 2. Add demos for downstream tasks including knowledge & difficulty & discrimination prediction, similarity prediction and paper segmentation. + 3. Refactor quesnet for pretrain and vectorization. + 4. Update documents about tutorials and API. + v0.0.9 1. Refactor tokenizer Basic Tokenizer and Pretrained Tokenizer 2. Refactor model structures following huggingface styles for Elmo, BERT, DisenQNet and QuesNet diff --git a/EduNLP/ModelZoo/quesnet/quesnet.py b/EduNLP/ModelZoo/quesnet/quesnet.py index a103645e..73b836e0 100644 --- a/EduNLP/ModelZoo/quesnet/quesnet.py +++ b/EduNLP/ModelZoo/quesnet/quesnet.py @@ -80,6 +80,7 @@ def __init__(self, _stoi=None, meta='know_name', pretrained_embs: np.ndarray = N self.config = {k: v for k, v in locals().items() if k not in ["self", "__class__", "kwargs"]} # self.config.update(kwargs) self.config["architecture"] = 'quesnet' + self.config["hidden_size"] = self.hidden_size = feat_size self.config = PretrainedConfig.from_dict(self.config) def init_h(self, batch_size): diff --git a/EduNLP/Pretrain/quesnet_vec.py b/EduNLP/Pretrain/quesnet_vec.py index d6b0ae78..a331157b 100644 --- a/EduNLP/Pretrain/quesnet_vec.py +++ b/EduNLP/Pretrain/quesnet_vec.py @@ -157,14 +157,14 @@ def _convert_to_ids(self, item: Union[str, dict, list], key=lambda x: x, token_item = self.tokenize(item, key) token_idx = [] for _, w in enumerate(token_item): - if isinstance(w, FigureSegment) and 'ques_figure_ids' in item.keys(): + if isinstance(w, FigureSegment) and isinstance(item, dict) and 'ques_figure_ids' in item.keys(): # image try: fig_id = f"{w.src[10:-1]}" fig_index = item['ques_figure_ids'].index(fig_id) - if self.img_dir != "": + if self.img_dir is not None: fig_src = os.path.join(self.img_dir, fig_id) if '.png' in item['ques_figure_paths'][fig_index]: fig_src += '.png'