我试图从字符串中删除停止词,但我想达到的条件是字符串中的命名实体不应该被删除。import spacytext = "The Bank of Australia has an agreement accordingwhich states that the deduction should be made at the last date of each month"如果我检查文
我正在使用python中的spacy库处理自然语言。从输入,我得到了几个句子,我分别使用这个对于每个发送,我使用.ents属性搜索任何命名实体。我想要实现的是用一个新的“发送”取代最初的“发送”,在最初的句子中,每一个被识别的实体都会被替换。After replacing: ORG is looking at buying GPE startup for MONEY
当然,使用一个简单的string.replace是行不通的,因为我想要一个新的spa
如果没有,那么我如何拆分/分发我的训练和测试数据,因为我正在使用注释和6个自定义实体,并且很难跟踪每个训练和测试数据中带注释的标签的百分比,因为它是均匀分布的。这是我用来训练的代码- TRAIN_DATA = data
# create the built-in pipeline components an