Closed surferfelix closed 2 years ago
The pipe
method is meant to take streams of documents, not a single document. So you need to use it like this:
# List of spacy doc objects; each doc object represents a sentence
docs = prepare_spacy_extensions(sents, labels, headers)
piped_docs = list(first_name_detector.pipe(docs))
# Displaying the documents one by one:
for doc in docs:
skweak.utils.display_entities(piped_docs)
Alternatively, if you want to apply the detector one document at a time, you can do this:
# List of spacy doc objects; each doc object represents a sentence
docs = prepare_spacy_extensions(sents, labels, headers)
# Applying skweak on each iteration
for doc in docs:
piped_doc = first_name_detector(doc)
skweak.utils.display_entities(piped_doc)
I am working on a project where I am trying to resolve conflicts in named entities, one of my steps involves using skweak.
I am experiencing the following problem.
This results in the following error
When I try to perform the same action with the entire doc object, it will return another error,
Presumably you want the larger doc object and sentence level docs are not supported? Though with my current system I am unable to aggregate everything into one large doc object. Are there any solutions to this problem?