Text Classification
TF-Keras
Italian
custom-multitask
bert
alberto
multi-task-learning
italian
gender-classification
ideology-detection
Instructions to use leeeov4/PIDIT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TF-Keras
How to use leeeov4/PIDIT with TF-Keras:
# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy) # See https://github.com/keras-team/tf-keras for more details. from huggingface_hub import from_pretrained_keras model = from_pretrained_keras("leeeov4/PIDIT") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -93,7 +93,7 @@ def preprocess_text(text, max_length=250):
|
|
| 93 |
### Inference
|
| 94 |
|
| 95 |
```python
|
| 96 |
-
text = "
|
| 97 |
inputs = preprocess_text(text)
|
| 98 |
outputs = model.predict(inputs)
|
| 99 |
|
|
@@ -102,7 +102,8 @@ ideology_binary_prob = outputs[1][0][0]
|
|
| 102 |
ideology_multiclass_probs = outputs[2][0]
|
| 103 |
|
| 104 |
print("Predicted gender (male probability):", gender_prob)
|
| 105 |
-
print("Predicted binary ideology (
|
| 106 |
-
print("Multiclass ideology distribution:", ideology_multiclass_probs)
|
|
|
|
| 107 |
|
| 108 |
```
|
|
|
|
| 93 |
### Inference
|
| 94 |
|
| 95 |
```python
|
| 96 |
+
text = "Oggi, sabato 31 dicembre, alle ore 9.34, nel Monastero Mater Ecclesiae in Vaticano, il Signore ha chiamato a Sé il Santo Padre Emerito Benedetto XVI."
|
| 97 |
inputs = preprocess_text(text)
|
| 98 |
outputs = model.predict(inputs)
|
| 99 |
|
|
|
|
| 102 |
ideology_multiclass_probs = outputs[2][0]
|
| 103 |
|
| 104 |
print("Predicted gender (male probability):", gender_prob)
|
| 105 |
+
print("Predicted binary ideology (left probability):", ideology_binary_prob)
|
| 106 |
+
print("Multiclass ideology distribution (left, right, moderate left, moderate right):", ideology_multiclass_probs)
|
| 107 |
+
|
| 108 |
|
| 109 |
```
|