Commit
·
8728d75
1
Parent(s):
c4744a2
Update usage.py
Browse files
usage.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
from transformers import pipeline
|
| 2 |
-
extractor = pipeline("text2text-generation", model="
|
| 3 |
-
intent ="I
|
|
|
|
|
|
|
| 4 |
label=extractor(intent)[0]["generated_text"]
|
| 5 |
if label=="":
|
| 6 |
-
label="No
|
| 7 |
print (label )
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
+
extractor = pipeline("text2text-generation", model="request-extraction")
|
| 3 |
+
intent ="I really need my broken window to be replaced, can John do it by today"
|
| 4 |
+
intent = " Can you come and have a look at our boiler"
|
| 5 |
+
|
| 6 |
label=extractor(intent)[0]["generated_text"]
|
| 7 |
if label=="":
|
| 8 |
+
label="No request detected"
|
| 9 |
print (label )
|