@@ -45,14 +45,13 @@ class T2V(object):
4545
4646 Examples
4747 --------
48- >>> item = [{'ques_content':'有公式$\\ FormFigureID{wrong1?}$和公式$\\ FormFigureBase64{wrong2?}$,\
49- ... 如图$\\ FigureID{088f15ea-8b7c-11eb-897e-b46bfc50aa29}$,若$x,y$满足约束条件$\\ SIFSep$,则$z=x+7 y$的最大值为$\\ SIFBlank$'}]
48+ >>> item = [{'ques_content':'有公式$\\ FormFigureID{wrong1?}$和公式$\\ FormFigureBase64{wrong2?}$, \
49+ ... 如图$\\ FigureID{088f15ea-8b7c-11eb-897e-b46bfc50aa29}$,若$x,y$满足约束条件$
50+ \\ SIFSep$,则$z=x+7 y$的最大值为$\\ SIFBlank$'}]
5051 >>> model_dir = "examples/test_model/d2v"
5152 >>> url, model_name, *args = get_pretrained_model_info('d2v_test_256')
5253 >>> path = get_data(url, model_dir); # doctest: +ELLIPSIS
53- downloader, INFO http://base.ustc.edu.cn/data/model_zoo/modelhub/doc2vec_pub/1/d2v_test_256.zip is saved as examples\t est_model\d2v\d2v_test_256.zip
54- Downloading examples\t est_model\d2v\d2v_test_256.zip 100.00%: 4.73MB | 4.73MB
55- downloader, INFO examples\t est_model\d2v\d2v_test_256.zip is unzip to examples\t est_model\d2v\d2v_test_256
54+ downloader, INFO ...
5655 >>> path = path_append(path, os.path.basename(path) + '.bin', to_str=True)
5756 >>> t2v = T2V('d2v',filepath=path)
5857 >>> print(t2v(item))
@@ -73,24 +72,20 @@ def __call__(self, items, *args, **kwargs):
7372 def infer_vector (self , items , * args , ** kwargs ):
7473 """
7574 get question embedding with T2V
76-
7775 Parameters
7876 ----------
7977 items:list
80- a list of question
81-
78+ a list of question
8279 Returns
8380 -------
8481 vector:list
8582 numpy.ndarray([dtype=float32)]
86-
8783 """
8884 return self .i2v .infer_vector (items , * args , ** kwargs )
8985
9086 def infer_tokens (self , items , * args , ** kwargs ):
9187 """
9288 get token embeddings with T2V
93-
9489 NotImplemented
9590 """
9691 return self .i2v .infer_tokens (items , * args , ** kwargs )
@@ -103,7 +98,6 @@ def vector_size(self) -> int:
10398def get_pretrained_model_info (name ):
10499 """
105100 get the pretrained model information with the given name
106-
107101 Parameters
108102 ----------
109103 name:str
@@ -116,11 +110,9 @@ def get_pretrained_model_info(name):
116110 bert_taledu_768
117111 disenq_math_256
118112 quesnet_math_512
119-
120113 Returns
121114 --------
122115 list: [model url (where to download), model name]
123-
124116 """
125117 url = MODELHUB_URL + 'getPretrainedModel'
126118 param = {'name' : name }
0 commit comments