From 95d49af6e1dc7cba843b74ba0d34ac40c8686ceb Mon Sep 17 00:00:00 2001 From: Owczarek Kamil Date: Mon, 24 Jun 2024 00:37:20 +0200 Subject: [PATCH] Removed printing from .py files --- calculate_tag_interest_similarity.py | 13 +------------ translate_tags_and_interests.py | 5 ----- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/calculate_tag_interest_similarity.py b/calculate_tag_interest_similarity.py index d977b78..60e4c03 100644 --- a/calculate_tag_interest_similarity.py +++ b/calculate_tag_interest_similarity.py @@ -84,23 +84,13 @@ def save_similarities_to_db(conn, tags, interests, similarities): def main(): conn = connect_to_db() try: - # Pobierz przetłumaczone tagi i zainteresowania translated_tags, translated_interests = get_translated_tags_and_interests(conn) - - # Rozdziel wyniki na oryginalne i przetłumaczone nazwy + tags, tags_ang = zip(*translated_tags) if translated_tags else ([], []) interests, interests_ang = zip(*translated_interests) if translated_interests else ([], []) - # Pobierz brakujące tagi i zainteresowania missing_tags, missing_interests = get_missing_tags_and_interests(conn) - print("Missing tags:") - for tag in missing_tags: - print(tag) - - print("\nMissing interests:") - for interest in missing_interests: - print(interest) if interests_ang and missing_tags: similarities_missing_tags = calculate_semantic_similarity_sbert(interests_ang, missing_tags) @@ -109,7 +99,6 @@ def main(): similarities_missing_interests = calculate_semantic_similarity_sbert(missing_interests, tags_ang) save_similarities_to_db(conn, tags, missing_interests, similarities_missing_interests) - print("\nSimilarities saved successfully.") finally: conn.close() diff --git a/translate_tags_and_interests.py b/translate_tags_and_interests.py index 80ecad5..5cdf88d 100644 --- a/translate_tags_and_interests.py +++ b/translate_tags_and_interests.py @@ -58,15 +58,10 @@ def main(): try: untranslated = get_untranslated_tags_and_interests(conn) - print("Untranslated tags and interests:") - for item in untranslated: - print(item) - translated = translate_to_english(untranslated) save_translations(conn, untranslated, translated) - print("\nTranslations saved successfully.") finally: conn.close()