diff --git a/summarizer/text_processors/sentence_handler.py b/summarizer/text_processors/sentence_handler.py index a0961a1..5ad2d19 100644 --- a/summarizer/text_processors/sentence_handler.py +++ b/summarizer/text_processors/sentence_handler.py @@ -39,4 +39,8 @@ def process( :return: Returns a list of sentences. """ doc = self.nlp(body) - return self.sentence_processor(doc, min_length, max_length) + + sentences = self.sentence_processor(doc, min_length, max_length) + unique_sentences = list(dict.fromkeys([s.strip() for s in sentences])) + + return unique_sentences