Text Classification
Transformers
PyTorch
Arabic
t5
text2text-generation
Classification
ArabicT5
Text Classification
Instructions to use Hezam/ArabicT5_Classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hezam/ArabicT5_Classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Hezam/ArabicT5_Classification")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Hezam/ArabicT5_Classification") model = AutoModelForSeq2SeqLM.from_pretrained("Hezam/ArabicT5_Classification") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -57,23 +57,6 @@ widget:
|
|
| 57 |
# # Example usage
|
| 58 |
```python
|
| 59 |
|
| 60 |
-
from transformers import T5ForConditionalGeneration, T5Tokenizer, pipeline
|
| 61 |
-
|
| 62 |
-
model_name = "Hezam/ArabicT5_Classification"
|
| 63 |
-
model = T5ForConditionalGeneration.from_pretrained(model_name)
|
| 64 |
-
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
| 65 |
-
generation_pipeline = pipeline("text-classification",model=model,tokenizer=tokenizer)
|
| 66 |
-
|
| 67 |
-
text = "الزين فيك القناه الاولي المغربيه الزين فيك القناه الاولي المغربيه اخبارنا المغربيه متابعه تفاجا زوار موقع القناه الاولي المغربي"
|
| 68 |
-
output= generation_pipeline(text,
|
| 69 |
-
num_beams=10,
|
| 70 |
-
max_length=3,
|
| 71 |
-
top_p=0.9,
|
| 72 |
-
repetition_penalty = 3.0,
|
| 73 |
-
no_repeat_ngram_size = 3)
|
| 74 |
-
|
| 75 |
-
output
|
| 76 |
-
|
| 77 |
```bash
|
| 78 |
-
|
| 79 |
```
|
|
|
|
| 57 |
# # Example usage
|
| 58 |
```python
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
```bash
|
| 61 |
+
|
| 62 |
```
|