Instructions to use hamzaMM/questionClassifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hamzaMM/questionClassifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="hamzaMM/questionClassifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("hamzaMM/questionClassifier") model = AutoModelForSequenceClassification.from_pretrained("hamzaMM/questionClassifier") - Notebooks
- Google Colab
- Kaggle
Create README.md
#2
by paulbauriegel - opened
README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
```python
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
pipe = pipeline(model="hamzaMM/questionClassifier", task="text-classification")
|
| 6 |
+
def is_question(input: str):
|
| 7 |
+
return pipe(input)[0]['label'] == 'LABEL_1'
|
| 8 |
+
|
| 9 |
+
is_question("How is the weather")
|
| 10 |
+
```
|