File size: 293 Bytes
b8794bf
0f7d53a
b8794bf
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from transformers import pipeline
extractor = pipeline("text2text-generation", model="datasetsANDmodels/location-extraction")

intent = " I will visit you at botanic garden."

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