Skip to content
Discussion options

You must be logged in to vote

I am trying to create a function to evaluate some annotation of my original test data, so I would like to know if is it possible to convert a .spacy file back to the annotation format.

The original annotation format is not saved anywhere in the Doc, so in the general case, no, the original annotations can't be generated right away. Depending on the format there might be third-party tools to produce it from Docs, like spacy_conll. All the relevant information should be saved in the Doc though, so generating it usually isn't hard.

Your input annotation format looks pretty simple, so you should just be able to create it from your Docs with short code like this.

out = []
for doc in docs:
  …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by vmatter
Comment options

You must be logged in to vote
2 replies
@polm
Comment options

@vmatter
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / serialize Feature: Serialization, saving and loading feat / doc Feature: Doc, Span and Token objects feat / training Feature: Training utils, Example, Corpus and converters
2 participants