我是spacy的新手,正在尝试使用Matcher。我不知道的是如何让匹配者在重叠时选择一个匹配。我希望能够同时匹配大脑和肿瘤,因为可能还有其他类型的肿瘤。我尝试使用回调函数,但无法从示例中找出如何使其工作。pattern1, pattern2)
this gives me (0,2, Brain Tumor) and (1,2, Tumor) 期望的输出是如何添加逻辑,然后让最终输出根据专家的需求进行选择。
在Spacy模式匹配中,如何编写可由以下模式触发的单个模式匹配规则: "red", apple" # ie, the rule must trigger when the input sentence"light", "fan"] # ie, the rule must trigger when the input sentence contains a token "light" 在上面的代码