Weather and Category

This commit is contained in:
2024-01-31 12:37:55 +01:00
parent f4a2251178
commit 232df1e4e0
24 changed files with 370 additions and 351 deletions

View File

@@ -123,6 +123,15 @@ if __name__ == '__main__':
category_options = ['politics','business','sport','magazine','scitech']
category_translation = {
'politics': 'Politika',
'business': 'Biznis',
'sport': 'Sport',
'magazine': 'Magazin',
'scitech': 'Nauka i tehnologija',
'other': 'Ostalo',
}
if ttk > 1900:
title_text = slice_title_if_needed(title_text)
try:
@@ -146,9 +155,10 @@ if __name__ == '__main__':
else:
category = 'other'
category = category_translation.get(category, category.capitalize())
vector = embeddings.embed_query(generated_text)
print(f"Title: {title}")
print(f"Category: {category}")
if not is_similar_data(title, text, link, vector, threshold=0.98):