datasetsANDmodels commited on
Commit
b8794bf
·
verified ·
1 Parent(s): b49f066

Create usage.py

Browse files
Files changed (1) hide show
  1. usage.py +9 -0
usage.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ extractor = pipeline("text2text-generation", model="location")
3
+
4
+ intent = " I will visit you at botanic garden."
5
+
6
+ label=extractor(intent)[0]["generated_text"]
7
+ if label=="":
8
+ label="No location detected"
9
+ print (label )