From 54c4b7a00c82e848f8b5b8e04ebdabd1973b05fe Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Sun, 7 Jan 2024 17:16:06 +0100 Subject: [PATCH] No issue. Clean up deprecation warnings --- tests/util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/util.py b/tests/util.py index c3e2bad..58d57d4 100644 --- a/tests/util.py +++ b/tests/util.py @@ -45,8 +45,8 @@ def load_newsgroup_training_data() -> List[TrainingDocument]: begin = 0 end = len(text) - cas.add_annotation(Sentence(begin=begin, end=end)) - cas.add_annotation(PredictedType(begin=begin, end=end, value=target_names[target])) + cas.add(Sentence(begin=begin, end=end)) + cas.add(PredictedType(begin=begin, end=end, value=target_names[target])) doc = TrainingDocument(cas, f"doc_{i}", USER) docs.append(doc) @@ -58,7 +58,7 @@ def load_newsgroup_test_data() -> List[Cas]: twenty_test = fetch_20newsgroups(subset="test", categories=NEWSGROUP_CATEGORIES, shuffle=True, random_state=42) typesystem = build_typesystem() - SentenceType = typesystem.get_type(SENTENCE_TYPE) + Sentence = typesystem.get_type(SENTENCE_TYPE) result = [] for text in twenty_test.data[:5]: @@ -67,7 +67,7 @@ def load_newsgroup_test_data() -> List[Cas]: begin = 0 end = len(text) - cas.add_annotation(SentenceType(begin=begin, end=end)) + cas.add(Sentence(begin=begin, end=end)) result.append(cas)