huggingface / neuralcoref

✨Fast Coreference Resolution in spaCy with Neural Networks
https://huggingface.co/coref/
MIT License
2.83k stars 474 forks source link

IGNORE : Convert spans to tokens? #320

Closed KTRosenberg closed 2 years ago

KTRosenberg commented 2 years ago

I am trying to analyze the sentence: "When particles and antiparticles collide, they explode."

This outputs: particles and antiparticles: [particles and antiparticles, they]

This glues "particles" and "antiparticles" together, but I need a mapping from all tokens in this fragment to the token indices in the original document.

i.e., I need something like: [[particles, antiparticles], they]

Can it be done? Thanks.

KTRosenberg commented 2 years ago

I apologize. Please ignore. I realized that using the span attributes, start and end I could get exactly what I wanted.