AllenNLP有一个predictor函数,可以接收JSON文件,然后输出JSON文件。从文档中可以@overrides predictor.load_line并编写一个函数来接收,比如说,一个文本文件。
您将如何编写此函数?以及如何实现该功能(即将其作为模块导入)?
AllenNLP load_line接口:https://allenai.github.io/allennlp-docs/api/allennlp.predictors.html?highlight=sentencetaggerpredictor#allennlp.predictors.predictor.Predictor
我在这里遵循教程:https://github.com/allenai/allennlp/blob/master/tutorials/tagger/README.md
发布于 2019-01-08 11:21:49
您可以在本地驱动器上安装AllenNLP框架,然后在那里手动更新代码。之后恢复正常功能,并重新加载更改。
或者,您可以使用dynamically update the class method。这就像修补第三方代码,并确保更新沿着链条分发。Another article here。
https://stackoverflow.com/questions/53974956
复制相似问题