From 3a5adb65aeb35ed9a7f7d8422847851184b42017 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Tue, 10 Aug 2021 13:29:48 +0300 Subject: [PATCH] Avoid creating list of uris --- annif/backend/svc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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):