fastnlp / fastNLP

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.
https://gitee.com/fastnlp/fastNLP
Apache License 2.0
3.06k stars 450 forks source link

您好,怎么进行inference呢 #262

Closed TianlinZhang668 closed 3 years ago

TianlinZhang668 commented 4 years ago

您好,怎么进行前向呢,因为只有tester的功能,如果给一个未标注的句子,怎么进行前向,输出标注结果,谢谢。

xuyige commented 4 years ago

您好,感谢您的issue 在fastNLP当中我们提供了一个Predictor,具体见https://github.com/fastnlp/fastNLP/blob/master/fastNLP/core/predictor.py

TianlinZhang668 commented 4 years ago

您好,使用这个函数,必须保证新的数据集dataset中包含所有field么,那这样需要重新load数据,并且重新给字词进行index排序吧,是不是有点复杂了,有什么简单的方式么。不是直接放进去输入自己进行操作么

yhcc commented 4 years ago

目前对inference的支持不太完善。需要自己对新load的数据进行预处理,index等。

onebula commented 4 years ago

Predictor 里的batch_size 是1,GPU环境下应该会有不少性能损失,建议暴露该参数