PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
11.98k stars 2.92k forks source link

C++想比较两个文档相似度,准备调用paddle inference+ernie3.0模型(ErnieMatchingSiamesePairwise),怎么把string转化为input tensor,有c++示例吗? #2681

Closed lbz0920 closed 1 year ago

lbz0920 commented 2 years ago

有c++示例可以提供吗

tianxin1860 commented 2 years ago

你好, C++ 的部署示例可以参考这里: https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/neural_search/recall/in_batch_negative/deploy/C%2B%2B。但是 ERNIE3.0 模型是预训练模型,不建议直接用来计算相似度。相似度计算的模型可以参考这里: https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/neural_search/ranking/ernie_matching

lbz0920 commented 2 years ago

PaddleNLP\applications\neural_search\ranking\ernie_matching和PaddleNLP\examples\text_matching\ernie_matching,代码都差不多,这两个示例有啥区别?这两个示例也需要训练,模型动转静再导出模型,也需要训练呀,和ernie3.0预训练模型有啥区别,不都需要训练导出吗?再c++调用paddle inference库+模型测试,是这样吗?

w5688414 commented 2 years ago

PaddleNLP\applications\neural_search\ranking\ernie_matching和PaddleNLP\examples\text_matching\ernie_matching,代码都差不多,这两个示例有啥区别?这两个示例也需要训练,模型动转静再导出模型,也需要训练呀,和ernie3.0预训练模型有啥区别,不都需要训练导出吗?再c++调用paddle inference库+模型测试,是这样吗?

没啥区别,都可以使用,只是neural_search是一个解决方案,ernie_matching只是其中的一部分,examples只是一个示例代码。

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。