Advertisement
gandalfbialy

Untitled

May 31st, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. from pprint import pprint
  2.  
  3. def main():
  4. data = load_email_data("spam.json", "ham.json")
  5. train, test = train_test_split(data)
  6.  
  7. # print(data)
  8.  
  9. model = train_nb(train)
  10. # pprint(model)
  11.  
  12. evaluate_model(model, test)
  13.  
  14. fetch_unread_emails_from_label(model)
  15.  
  16. # while True:
  17. # user_input = input("Wpisz wiadomość do klasyfikacji (lub 'q' aby zakończyć): ")
  18. # if user_input.lower() == 'q':
  19. # break
  20. # prediction = predict(model, user_input)
  21. # print(f"Klasyfikacja: {prediction.upper()}")
  22.  
  23. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement