From 55ff05fc8ed8839aac712f80306ffb67b8f0400c Mon Sep 17 00:00:00 2001 From: nsantacruz Date: Sun, 26 May 2024 12:07:35 +0300 Subject: [PATCH] feat: temp solution to avoid generating descriptions for certain topics --- app/util/topic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/util/topic.py b/app/util/topic.py index f9e6f85..94fe355 100644 --- a/app/util/topic.py +++ b/app/util/topic.py @@ -34,7 +34,12 @@ def generate_topic_description(topic: Topic, text: str) -> str: def get_or_generate_topic_description(topic: Topic, verbose=True) -> str: + # TODO create a general approach for deciding when a description isn't needed + dont_auto_generate_desc = {'poverty'} description = topic.description.get('en', '') + if topic.slug in dont_auto_generate_desc: + # these topics are better with just their titles. any description will limit their scope unnecessarily. + return description if not description: description = get_topic_description_from_webpages(topic) if description and verbose: