Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasilisa-Blyudova committed Apr 22, 2024
2 parents 579f492 + 77b6c06 commit 36b2065
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions core_utils/article/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from datetime import datetime
from typing import Optional, Protocol, Sequence

from stanza.utils.conll import Document

from core_utils.constants import ASSETS_PATH


Expand Down Expand Up @@ -110,7 +108,7 @@ class Article:
"""
#: A date
date: Optional[datetime]
_conllu_sentences: Sequence[SentenceProtocol] | Document
_conllu_sentences: Sequence[SentenceProtocol]

def __init__(self, url: Optional[str], article_id: int) -> None:
"""
Expand Down Expand Up @@ -204,8 +202,6 @@ def get_cleaned_text(self) -> str:
Returns:
str: Cleaned text.
"""
if isinstance(self._conllu_sentences, Document):
return str(self._conllu_sentences.text)
return ' '.join([sentence.get_cleaned_sentence() for
sentence in self._conllu_sentences])

Expand Down

0 comments on commit 36b2065

Please sign in to comment.