Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,9 @@ import mediapipe as mp
|
|
| 3 |
#from transformers import pipeline
|
| 4 |
|
| 5 |
base_options = mp.tasks.BaseOptions(model_asset_path="classifier.tflite")
|
| 6 |
-
options
|
| 7 |
with mp.tasks.text.TextClassifier.create_from_options(options) as classifier:
|
| 8 |
-
text
|
| 9 |
result = classifier.classify(text)
|
| 10 |
|
| 11 |
category = result.classifications[0].categories[0]
|
|
|
|
| 3 |
#from transformers import pipeline
|
| 4 |
|
| 5 |
base_options = mp.tasks.BaseOptions(model_asset_path="classifier.tflite")
|
| 6 |
+
options = mp.tasks.text.TextClassifierOptions(base_options=base_options)
|
| 7 |
with mp.tasks.text.TextClassifier.create_from_options(options) as classifier:
|
| 8 |
+
text = st.text_area("enter some text")
|
| 9 |
result = classifier.classify(text)
|
| 10 |
|
| 11 |
category = result.classifications[0].categories[0]
|