Downloads · 30 days
10
17% of all-time downloads
konverner/8bit-distilcamembert-base-ner
8bit-distilcamembert-base-ner is a token classification model from konverner. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
This is an 8bit version of distilcamembert-base-ner obtained with Intel® Neural Compressor on wikinerfr dataset.
Downloads · 30 days
10
17% of all-time downloads
All-time downloads
59
Public
Repo size
69.5 MB
Likes
0
Public
Click a slice to open those files.
.bin68.7 MB · 96%
From the Hugging Face model README
This is an 8bit version of distilcamembert-base-ner obtained with Intel® Neural Compressor on wikiner_fr dataset.
First, install libraries:
pip install --upgrade-strategy eager "optimum[neural-compressor]" > null
Second, use INCModelForTokenClassification from optimum.intel . It can be used in the similar way as
an ordinary DistilBertForTokenClassification:
from transformers import AutoModelForTokenClassification, AutoTokenizer
from optimum.intel import INCModelForTokenClassification
model = INCModelForTokenClassification.from_pretrained('konverner/8bit-distilcamembert-base-ner')
tokenizer = AutoTokenizer.from_pretrained('konverner/8bit-distilcamembert-base-ner')
text = "Meta Platforms ou Meta, anciennement connue sous le nom de Facebook, est une multinationale américaine fondée en 2004 par Mark Zuckerberg."
model_input = tokenizer(text, return_tensors='pt')
model_output = model(**model_input)
print(model_output.logits.argmax(2))
# tensor([[0, 4, 4, 4, 4, 4, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0,
# 0, 0, 0, 2, 2, 2, 2, 2, 0, 0]])