Skip to content

Commit

Permalink
No issue. Clean up deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
reckart committed Jan 7, 2024
1 parent 876d3e8 commit 54c4b7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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]:
Expand All @@ -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)

Expand Down

0 comments on commit 54c4b7a

Please sign in to comment.