File size: 883 Bytes
d7c69c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Copyright 2026 Cobuild Tech Private Limited
# SPDX-License-Identifier: Apache-2.0
"""Run from the model folder:  python example.py   (all messages below are invented)"""
from cbx_intent import IntentClassifier

clf = IntentClassifier(".")
messages = [
    "My new card was posted ten days ago and it still hasn't shown up",
    "Can I add money to my account using Google Pay?",
    "I sent 200 euros to my sister on Monday and she says nothing has arrived",
    "The cash machine at the station kept my card, what now?",
    "Why was I charged a fee for taking cash out at an ATM?",
    "I typed the wrong PIN too many times and now it's locked",
    "There's a payment from a shop I've never been to on my statement",
    "how old do u have to be to open an account",
]
for r in clf.classify(messages):
    print(f"{r['text'][:60]:60s} -> {r['intent']} ({r['confidence']:.2f})")