Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import intentparser
- intent = intentparser.intentParser({
- 'description' : {
- "type" : 'TimeIntent', #ประเภท
- "args" : [(1, "scopes")], # aregument ที่ต้องการ 1 แปลว่าต้องการหรือไม่ต้องการก็ได้
- "keyword" : [ #มีคีย์เวิร์ดเพิ่มขึ้นมา
- (0, "time_keyword"),
- (1, "scopes")
- ]},
- 'time_keyword' : ['is', 'are', 'what', 'how', 'clock', 'how\'s'], #อันนี้คีย์เวิร์ดหลัก
- 'scopes' : [ # สโคปของเรา
- "day",
- "time"
- ]
- })
- intent.teachWords(["What time is it?", "How's the clock", "What is this day"]) # สอนประโยคเหมือนเดิม
- print(intent.getResult("What time is it?")) #ทดลองเหมือนเดิม
- print(intent.getResult("How's the clock"))
Advertisement
Add Comment
Please, Sign In to add comment