Skip to content

Commit

Permalink
Removed printing from .py files
Browse files Browse the repository at this point in the history
  • Loading branch information
bilimig committed Jun 23, 2024
1 parent c749b18 commit 95d49af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
13 changes: 1 addition & 12 deletions calculate_tag_interest_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()

Expand Down
5 changes: 0 additions & 5 deletions translate_tags_and_interests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 95d49af

Please sign in to comment.