File size: 361 Bytes
c4744a2
8728d75
 
 
 
c4744a2
 
8728d75
c4744a2
1
2
3
4
5
6
7
8
9
from transformers import pipeline
extractor = pipeline("text2text-generation", model="request-extraction")
intent  ="I really need my broken window to be replaced, can John do it by today"
intent = " Can you come and have a look at our boiler"

label=extractor(intent)[0]["generated_text"]
if label=="":
               label="No request detected"
print (label )