Upload occ-use.py
Browse files- occ-use.py +9 -0
occ-use.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import websockets
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
extractor = pipeline("text2text-generation", model="occ")
|
| 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 |
+
|