Weather and Category
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user