SimNet通过向量计算句子之间的相似度吗?如果是,怎样获得句子的向量值?
您好,是PaddleNLP还是PaddleRec下面的SimNet?获得句子的向量值可以把要得到的句子的变量名放到fetch_list里fetch出来。
您好,是PaddleNLP还是PaddleRec下面的SimNet?获得句子的向量值可以把要得到的句子的变量名放到fetch_list里fetch出来。
你好,是PaddleNLP里的。谢谢回答,能详细说一下吗?
比如https://github.com/PaddlePaddle/models/blob/6791e34a716761a7e8277d4414b5609e9cc8729f/PaddleNLP/models/matching/mm_dnn.py#L148这里,想拿到left_seq_encoder的值的话,在executor run的时候 fetch_list=[left_seq_encoder.name] 就可以拿到这个值了,executor run的示例可以在下面的链接看 https://www.paddlepaddle.org.cn/documentation/docs/zh/1.5/api_cn/executor_cn.html#run
比如https://github.com/PaddlePaddle/models/blob/6791e34a716761a7e8277d4414b5609e9cc8729f/PaddleNLP/models/matching/mm_dnn.py#L148这里,想拿到left_seq_encoder的值的话,在executor run的时候 fetch_list=[left_seq_encoder.name] 就可以拿到这个值了,executor run的示例可以在下面的链接看 https://www.paddlepaddle.org.cn/documentation/docs/zh/1.5/api_cn/executor_cn.html#run
明白了,谢谢!
能请问如果用pre-train的模型,又该如何呢?fluid.io.load_inference_model后,fetch没办法加上像上面的例子一样加上对应layer变量。
比如https://github.com/PaddlePaddle/models/blob/6791e34a716761a7e8277d4414b5609e9cc8729f/PaddleNLP/models/matching/mm_dnn.py#L148这里,想拿到left_seq_encoder的值的话,在executor run的时候 fetch_list=[left_seq_encoder.name] 就可以拿到这个值了,executor run的示例可以在下面的链接看 https://www.paddlepaddle.org.cn/documentation/docs/zh/1.5/api_cn/executor_cn.html#run