generated_from_trainer NER token-classification

NER-Luxury

A fine-tuned XLM-Roberta model for NER in the fashion and luxury industry

1. Goal

For example, the disambiguation of Louis Vuitton:

2. Prototyping, dataset limitation, and bias

I started a NER model based on various architectures with my dataset in English, French, and Japanese. I achieved weak results in English due to the dominance of linguistic specificities of French in the fashion and luxury industry (for example Hermès, prêt-à-porter, Château-Grillet, or Héliotrope). The Japanese results were also poor due to the span across word boundaries in the SentencePiece encoding, as kindly advised by Kaito Sugimoto of the University of Tokyo.

For NER-Luxury, I decided to focus on a carefully crafted bespoke dataset, stable deep learning architecture, and the speed of the new version 2.0 PyTorch. I annotated more than 38.063 sentences in English (758.309 words) for 32 labels with classic ones such as Date, Location, and Money (Monetary value), and bespoke labels for the fashion and luxury industries.

3. Model technical description and hyperparameters

4. Hierarchical methodology

The "Savigny Luxury Index" of Pierre Mallevays Co-Head of Merchant Banking at Stanhope Capital gave me a clear perspective on the luxury industry with the major groups such as LVMH, Kering, Richemont, Swatch, etc. Then I built on sportswear brands focused on performance such as Nike, Adidas, and Lululemon. I avoided The Transparency Index since you can be transparent about your own factories but lie about the supplier of the supplier. My choice was to build the index of fast fashion brands such as Zara, Shein, Boohoo, Primark, and Victoria Secret's based on their popularity ranking among teenagers. For sustainability, I adopted keywords of the Principles for Responsible Investment (UNPRI or PRI) and ESG Corporate reporting tool developed by the Ethical Fashion Initiative led by Simone Cipriani and his team.

5. Classification bias

The lexicon in the fashion and luxury industry is strongly biased toward French technical words that are clearly out-of-vocabulary (OOV) in English. NER-Luxury is heavily biased with the label (Company) with more than 30,000 companies that have been consolidated or disappeared over the years.

The data is unbalanced in the portfolio of houses for listed groups, LVMH Group is composed of more than 70 entities (Louis Vuitton, Dior, Tiffany, Fendi, etc.), while Burberry is one major fashion house. Entities such as Artémis Group of Kering or Mousse Partners of Chanel with the label "Holding/Trust" are quite rare, so I had to create synthetic sentences.  During classification, I made the deliberate choice of labeling luxury watchmakers such as Cartier, Patek Philippe, A. Lange & Soehne, etc. with the label "House" for their duality in creativity and technicity. I also classified perfumers with the perfume houses, such as Diptyque, Guerlain, Lancôme, etc. with the label "House" for the creative side. While, I attributed the label "Brand" to cosmetic brands such as la Roche-Posay, Clinique, and La Mer due to scientific research.

6. NER bespoke labels

Entities are evolving according to temporality, and context.

Abbreviation | Description (Examples)

How to use NER-Luxury with HuggingFace?

Load NER-Luxury and its sub-word tokenizer :

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("AkimfromParis/NER-Luxury")
model = AutoModelForTokenClassification.from_pretrained("AkimfromParis/NER-Luxury")
nlp = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")

example = "CEO Leena Nair dismisses IPO rumours for Chanel."
ner_results = nlp(example)
print(ner_results)

NER-Luxury results with Seqeval:

This model is a fine-tuned version of xlm-roberta-base.

It achieves the following results on the evaluation set:

The following hyperparameters were used during training:

Training results

Training Loss Epoch Step Validation Loss Precision Recall F1 Accuracy
1.1191 1.0 1072 0.5983 0.6200 0.6863 0.6515 0.9066
0.5722 2.0 2144 0.4722 0.6918 0.7444 0.7172 0.9242
0.4389 3.0 3216 0.4148 0.7187 0.7744 0.7455 0.9319
0.3545 4.0 4288 0.3942 0.7368 0.7862 0.7607 0.9361
0.3015 5.0 5360 0.3898 0.7425 0.7954 0.7680 0.9374
0.2542 6.0 6432 0.3888 0.7492 0.7964 0.7721 0.9380
0.2279 7.0 7504 0.3878 0.7602 0.8020 0.7805 0.9421
0.2015 8.0 8576 0.3913 0.7612 0.8028 0.7814 0.9412
0.1809 9.0 9648 0.3970 0.7648 0.8070 0.7853 0.9417
0.1663 10.0 10720 0.3990 0.7686 0.8082 0.7879 0.9427

Framework versions

Please feel free to connect me: Akim Mousterou - <!-- fhetydagzzzgjds --> moakim@<!-- sdfjsdhfkjypcs -->proton<!-- asjoxp -->mail.com </p> Copyright NER-Luxury [2023] [Akim Mousterou]