简体   繁体   中英

Spacy : A token can only be part of one entity, so make sure the entities you're setting don't overlap.. how to make use of filter_spans

Assuming below is my train data

TRAIN_DATA = [
        ("PRICE INCREASED EVERY 6 HOURS", {"entities": [(16, 29, "TIME"),(22, 29, "TIME")]}),
        ("DISCOUNT SALES ANNOUNCED FOR  2 TIMES DAILY", {"entities": [(30, 43, "ORG"),(38, 43, "ORG")]})]

How to use spacy.util.filter_spans() to correct my training data to longer spans.

Assuming below is my train data

TRAIN_DATA = [
        ("PRICE INCREASED EVERY 6 HOURS", {"entities": [(16, 29, "TIME"),(22, 29, "TIME")]}),
        ("DISCOUNT SALES ANNOUNCED FOR  2 TIMES DAILY", {"entities": [(30, 43, "ORG"),(38, 43, "ORG")]})]

How to use spacy.util.filter_spans() to correct my training data to longer spans.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM