diff --git a/annif/backend/svc.py b/annif/backend/svc.py index 5fbeccf5a..da8e46a86 100644 --- a/annif/backend/svc.py +++ b/annif/backend/svc.py @@ -56,7 +56,7 @@ def _corpus_to_texts_and_classes(self, corpus): self.warning( 'training on a document with multiple subjects is not ' + 'supported by SVC; selecting one random subject.') - classes.append(list(doc.uris)[0]) + classes.append(iter(doc.uris).next()) return texts, classes def _train_classifier(self, veccorpus, classes):