From a45c7c9e096ed19376ec119a619e827c25ee9833 Mon Sep 17 00:00:00 2001 From: Mert Cobanov Date: Wed, 1 May 2024 20:08:29 +0300 Subject: [PATCH] Refactor code to improve readability and maintainability --- summarizer.py | 2 -- yt_summarizer.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/summarizer.py b/summarizer.py index 7c6a1c5..dd4a191 100644 --- a/summarizer.py +++ b/summarizer.py @@ -57,8 +57,6 @@ def main(): llm_chain = setup_summarization_chain() result = llm_chain.run(docs) - print(result) - if __name__ == "__main__": main() diff --git a/yt_summarizer.py b/yt_summarizer.py index 8e79620..0f08160 100644 --- a/yt_summarizer.py +++ b/yt_summarizer.py @@ -8,6 +8,7 @@ from langchain_core.prompts import PromptTemplate def check_link(link): + """The function `check_link` uses a regular expression to check if a given link is a valid YouTube video link.""" yt_regex = r"^(?:https?:\/\/)?(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]+)(?:\?.*)?$" return re.match(yt_regex, link) is not None