File size: 428 Bytes
5576acd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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']}"
    )