Text Classification
Transformers
PyTorch
TensorBoard
bert
Generated from Trainer
text-embeddings-inference
Instructions to use HCKLab/BiBert-MultiTask-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HCKLab/BiBert-MultiTask-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="HCKLab/BiBert-MultiTask-2")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("HCKLab/BiBert-MultiTask-2") model = AutoModelForSequenceClassification.from_pretrained("HCKLab/BiBert-MultiTask-2") - Notebooks
- Google Colab
- Kaggle
modify how to get label
Browse files
__pycache__/bert_for_sequence_classification.cpython-37.pyc
CHANGED
|
Binary files a/__pycache__/bert_for_sequence_classification.cpython-37.pyc and b/__pycache__/bert_for_sequence_classification.cpython-37.pyc differ
|
|
|
__pycache__/bibert_multitask_classification.cpython-37.pyc
CHANGED
|
Binary files a/__pycache__/bibert_multitask_classification.cpython-37.pyc and b/__pycache__/bibert_multitask_classification.cpython-37.pyc differ
|
|
|
__pycache__/handler.cpython-37.pyc
CHANGED
|
Binary files a/__pycache__/handler.cpython-37.pyc and b/__pycache__/handler.cpython-37.pyc differ
|
|
|
handler.py
CHANGED
|
@@ -75,10 +75,8 @@ class EndpointHandler():
|
|
| 75 |
prediction_res = [{"label":"Neutral"}]
|
| 76 |
else:
|
| 77 |
classifier_subj = self.classifier_s(inputs)
|
| 78 |
-
logger.info("Prediction subjective %s", classifier_subj)
|
| 79 |
-
label = classifier_subj[0]['label']
|
| 80 |
-
for key in idtolabel.keys():
|
| 81 |
-
label = label.replace(key, idtolabel[key])
|
| 82 |
prediction_res = [{"label":label}]
|
| 83 |
elapsed = 1000 * (perf_counter() - t0)
|
| 84 |
logger.info("Model prediction time: %d ms.", elapsed)
|
|
|
|
| 75 |
prediction_res = [{"label":"Neutral"}]
|
| 76 |
else:
|
| 77 |
classifier_subj = self.classifier_s(inputs)
|
| 78 |
+
logger.info("Prediction subjective %s", classifier_subj)
|
| 79 |
+
label = idtolabel.get(classifier_subj[0]['label'])
|
|
|
|
|
|
|
| 80 |
prediction_res = [{"label":label}]
|
| 81 |
elapsed = 1000 * (perf_counter() - t0)
|
| 82 |
logger.info("Model prediction time: %d ms.", elapsed)
|