From 680043ebca7b695933d4935e6d189c54e27fa087 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 12 Aug 2017 08:54:21 -0500 Subject: [PATCH] Improve efficiency of tagger.set_annotations for GPU --- spacy/pipeline.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index b87f73c27..f367d2b5b 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -284,6 +284,8 @@ class NeuralTagger(BaseThincComponent): cdef Vocab vocab = self.vocab for i, doc in enumerate(docs): doc_tag_ids = batch_tag_ids[i] + if hasattr(doc_tag_ids, 'get'): + doc_tag_ids = doc_tag_ids.get() for j, tag_id in enumerate(doc_tag_ids): # Don't clobber preset POS tags if doc.c[j].tag == 0 and doc.c[j].pos == 0: