Commit
·
b653e77
1
Parent(s):
75722f1
Update usage.py
Browse files
usage.py
CHANGED
@@ -1,3 +1,9 @@
|
|
1 |
import websockets
|
2 |
from transformers import pipeline
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|