Spaces:
Running
Running
from slotmatch import SlotExtractor | |
from pprint import pprint | |
schema = { | |
"name": str, | |
"intent": str, | |
"destination": str | |
} | |
llm_output = ''' | |
Hi, I’m Alice. I’d like to book a flight to New York. | |
{ | |
"intnt": "book_flight", | |
"dest": "New York", | |
"name": "Alice" | |
} | |
''' | |
extractor = SlotExtractor(schema) | |
result = extractor.extract(llm_output) | |
pprint(result) |