Downloads · 30 days
299
1% of all-time downloads
tunis-ai/TunBERT
TunBERT is a text classification model from tunis-ai. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This is a converted version of Instadeep's TunBERT from nemo to safetensors.
Downloads · 30 days
299
1% of all-time downloads
All-time downloads
21.3K
Public
Parameters
110M
1.3 GB on disk
Likes
15
Trending 1
Click a slice to open those files.
.bin440 MB · 50%
From the Hugging Face model README
This is a converted version of Instadeep's TunBERT from nemo to safetensors.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("tunis-ai/TunBERT")
model = AutoModelForSequenceClassification.from_pretrained("tunis-ai/TunBERT",trust_remote_code=True)
text = "[insert text here]"
inputs = tokenizer(text,return_tensors='pt')
output = model.process(**inputs) # -> List["positive" or "negative"]
or you can use the normal forward method (currently compatible with the Trainer class)
text = "[insert text here]"
inputs = tokenizer(text,return_tensors='pt')
output = model(**inputs)
or you can use the pipeline :
⚠️currently broken try an older version of transformers until i raise this, in the mean time use the model.process method mentioned above
from transformers import pipeline
pipe = pipeline(model="tunis-ai/TunBERT",tokenizer = "tunis-ai/TunBERT",trust_remote_code=True)
pipe("text")