Instructions to use adisyonist/14-allergens-0.1B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use adisyonist/14-allergens-0.1B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="adisyonist/14-allergens-0.1B-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("adisyonist/14-allergens-0.1B-v2") model = AutoModelForSequenceClassification.from_pretrained("adisyonist/14-allergens-0.1B-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
14-Allergens 0.1B
English
Overview
14-Allergens 0.1B is a multilingual multi-label classification model for identifying likely allergens from restaurant menu text.
The model is designed for short menu inputs such as product titles or product titles combined with short descriptions. It is intended for restaurant software, menu understanding, food-data processing, search, normalization, and allergen-assistance workflows.
The model was fine-tuned on approximately 294K multilingual restaurant-menu examples covering a wide range of languages, cuisines, product names, and menu-description styles.
Fine-tuned from microsoft/Multilingual-MiniLM-L12-H384.
Allergen vocabulary
The model predicts the following 14 canonical allergen labels:
gluten, crustaceans, eggs, fish, peanuts, soy, milk, tree_nuts, celery, mustard, sesame, sulphites, lupin, molluscs
This is a multi-label model, so a single menu item may contain zero, one, or multiple predicted allergens.
Intended input
Examples:
Pistachio Cannoli
or:
Pistachio Cannoli. Crispy pastry filled with sweet ricotta and pistachio.
The model was trained using:
- product title
- product title + short description
Ingredient lists are not required as model input.
Recommended thresholds
The repository includes a thresholds.json file containing the recommended decision threshold for each allergen.
These thresholds were tuned separately for each allergen using the validation split.
Users may choose different thresholds depending on whether higher recall or higher precision is preferred for their use case.
Intended use
- Predicting likely allergens from restaurant menu text
- Assisting menu normalization and enrichment
- Restaurant and food-service software
- Food search and categorization
- Providing candidate allergen labels for human review
Limitations and safety
The model predicts allergens from menu text and does not inspect the actual ingredients used by a restaurant.
Recipes, preparation methods, substitutions, and regional variations may change allergen content.
Menu titles may omit ingredients that are relevant to allergy safety.
Cross-contact and trace-allergen information generally cannot be determined reliably from a product title or short description.
The model should therefore be used as an assistive prediction system and not as the sole source of truth for allergy-sensitive decisions.
Ingredient and allergen information should be verified with the food provider when safety is critical.
Framework
- Transformers
- PyTorch
- Multilingual MiniLM
- Multi-label sequence classification
- Sigmoid probabilities
- Per-allergen decision thresholds
Author
Created by Ömer Faruk ŞAHAN
Hugging Face: https://huggingface.co/omerfsahan
Türkçe
Genel bakış
14-Allergens 0.1B, restoran menü metinlerinden olası alerjenleri belirlemek için geliştirilmiş çok dilli ve çok etiketli bir sınıflandırma modelidir.
Model, ürün adı veya ürün adıyla birlikte verilen kısa açıklamaları işlemek üzere tasarlanmıştır.
Restoran yazılımları, menü anlama, veri normalizasyonu, arama, sınıflandırma ve alerjen destek sistemlerinde kullanılabilir.
Model yaklaşık 294 bin çok dilli restoran menüsü örneği üzerinde fine-tune edilmiştir. Veri; farklı dilleri, mutfakları, ürün adlarını ve kısa menü açıklamalarını kapsamaktadır.
Model, microsoft/Multilingual-MiniLM-L12-H384 temel modeli üzerine fine-tune edilmiştir.
Alerjen sözlüğü
Model aşağıdaki 14 canonical alerjen etiketini tahmin eder:
gluten, crustaceans, eggs, fish, peanuts, soy, milk, tree_nuts, celery, mustard, sesame, sulphites, lupin, molluscs
Model çok etiketlidir. Bir ürün sıfır, bir veya birden fazla alerjen içerebilir.
Model girdisi
Örnek:
Fıstıklı Baklava
veya:
Fıstıklı Baklava. Antep fıstığı ve şerbet ile hazırlanan geleneksel tatlı.
Eğitim sırasında:
- yalnızca ürün adı
- ürün adı + kısa açıklama
formatları kullanılmıştır.
Malzeme listesi model girdisi olarak zorunlu değildir.
Önerilen eşik değerleri
Repo içerisinde her alerjen için önerilen karar eşiklerini içeren thresholds.json dosyası bulunmaktadır.
Bu eşikler validation verisi üzerinde her alerjen için ayrı ayrı ayarlanmıştır.
Kullanıcılar kendi kullanım senaryolarına göre farklı precision/recall dengeleri için farklı eşikler belirleyebilir.
Kullanım amaçları
- Menü metninden olası alerjenlerin tahmin edilmesi
- Menü normalizasyonu ve zenginleştirilmesi
- Restoran ve yiyecek servis yazılımları
- Gıda arama ve sınıflandırma sistemleri
- İnsan denetimine sunulacak aday alerjen etiketlerinin üretilmesi
Sınırlamalar ve güvenlik
Model gerçek tarif veya kullanılan malzemeleri doğrudan görmez; yalnızca menü metninden tahmin üretir.
Restoran tarifleri, hazırlama yöntemleri, ikameler ve bölgesel farklılıklar alerjen içeriğini değiştirebilir.
Ürün adında belirtilmeyen malzemeler bulunabilir.
Ayrıca çapraz bulaşma veya eser miktarda alerjen bilgisi yalnızca ürün adı veya kısa açıklamadan güvenilir şekilde belirlenemez.
Bu nedenle model, özellikle alerji güvenliği açısından tek doğruluk kaynağı olarak kullanılmamalıdır.
Kritik durumlarda içerik ve alerjen bilgileri restoran veya gıda sağlayıcısı tarafından doğrulanmalıdır.
Geliştirici
Geliştiren: Ömer Faruk ŞAHAN
Hugging Face: https://huggingface.co/omerfsahan
- Downloads last month
- -