我目前正在构建一个带有自定义NER、实体链接器和Textcat组件的spacy管道。对于我的实体链接器组件,我已经修改了candidate_generator()以适应我的用例。我借鉴了的演示项目。下面是我的custom_functions代码。nlp.make_doc to ensure we have entities and sentences
# which are needed during training of the e
for each sentence with each other sentence
cosine_scores = util.pytorch_cos_sim(embeddings, embeddings因为在4个句子的组合之间可以有6个相似性分数的组合。在他们的文档页面上,他们提到由于二次复杂性,这不能很好地扩展,因此他们建议使用paraphrase_mining()方法。 但是当我尝试使用这种方法时,我没有得到6个组合,而是只得到