Downloads · 30 days
17
46% of all-time downloads
Estonel/distilled_bert_with_french
distilled_bert_with_french is a machine learning model from Estonel. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a distilled version of BERT fine-tuned for multilingual sequence classification, with a focus on French text processing. The model demonstrates strong performance across French, Hindi, and English languages.
Downloads · 30 days
17
46% of all-time downloads
All-time downloads
37
Public
Repo size
1.2 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.2 GB · 100%
From the Hugging Face model README
This is a distilled version of BERT fine-tuned for multilingual sequence classification, with a focus on French text processing. The model demonstrates strong performance across French, Hindi, and English languages.
The model achieved the following performance on evaluation datasets:
{
"model_type": "distilbert",
"architectures": ["DistilBertForSequenceClassification"],
"n_layers": 6,
"n_heads": 12,
"dim": 768,
"hidden_dim": 3072,
"max_position_embeddings": 512,
"vocab_size": 119547,
"activation": "gelu",
"attention_dropout": 0.1,
"dropout": 0.1,
"seq_classif_dropout": 0.2
}
config.json: Model configurationtokenizer_config.json: Tokenizer configurationtokenizer.json: Fast tokenizer filevocab.txt: Vocabulary filespecial_tokens_map.json: Special tokens mappingbert_model.onnx: ONNX model for inferencebert_model_optimized.onnx: Optimized ONNX modelbert_model_optimized_dynamic_int8.onnx: INT8 quantized ONNX modelmetrics.yaml: Detailed performance metricsfrom transformers import DistilBertTokenizer, DistilBertForSequenceClassification
import torch
# Load model and tokenizer
model = DistilBertForSequenceClassification.from_pretrained("your-username/distilled_bert_french_12")
tokenizer = DistilBertTokenizer.from_pretrained("your-username/distilled_bert_french_12")
# Example inference
text = "Votre texte français ici"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
print(f"Predictions: {predictions}")
import onnxruntime as ort
from transformers import DistilBertTokenizer
import numpy as np
# Load tokenizer and ONNX model
tokenizer = DistilBertTokenizer.from_pretrained("your-username/distilled_bert_french_12")
session = ort.InferenceSession("bert_model_optimized.onnx")
# Prepare input
text = "Votre texte français ici"
inputs = tokenizer(text, return_tensors="np", truncation=True, padding=True, max_length=512)
# Run inference
outputs = session.run(None, {
"input_ids": inputs["input_ids"],
"attention_mask": inputs["attention_mask"]
})
predictions = outputs[0]
print(f"Predictions: {predictions}")
The model includes three ONNX variants for different deployment scenarios:
bert_model.onnx): Full precision modelbert_model_optimized.onnx): Graph optimizations appliedbert_model_optimized_dynamic_int8.onnx): Quantized for faster inferencePlease ensure you comply with the original BERT license and any dataset licenses used during training.
If you use this model in your research, please cite:
@misc{distilled_bert_french_12,
title={DistilBERT French Multilingual Sequence Classification},
author={Your Name},
year={2024},
howpublished={Hugging Face Model Hub},
url={https://huggingface.co/your-username/distilled_bert_french_12}
}
For questions or issues, please open an issue in the model repository or contact [[email protected]].