datasetsANDmodels commited on
Commit
b653e77
·
1 Parent(s): 75722f1

Update usage.py

Browse files
Files changed (1) hide show
  1. usage.py +7 -1
usage.py CHANGED
@@ -1,3 +1,9 @@
1
  import websockets
2
  from transformers import pipeline
3
- extractor5 = pipeline("text2text-generation", model="occ_extract")
 
 
 
 
 
 
 
1
  import websockets
2
  from transformers import pipeline
3
+ extractor = pipeline("text2text-generation", model="occ_extract")
4
+ intent ="I need a lawn mower for my garden"
5
+ label=extractor(intent)[0]["generated_text"]
6
+ if label=="":
7
+ label="No occupation detected"
8
+ print (label )
9
+