| from inference import UserNeedsClassifier | |
| model = UserNeedsClassifier() | |
| predictions = model.predict( | |
| query="How can I improve my morning exercise routine?", | |
| snippet="I want a short beginner workout that I can do at home.", | |
| ) | |
| for prediction in predictions: | |
| print( | |
| f"{prediction['score']:.4f} " | |
| f"{prediction['category_id_path']} " | |
| f"{prediction['category_path_en']}" | |
| ) | |