jonny9f commited on
Commit
ebf2a8b
·
verified ·
1 Parent(s): e49df41

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +29 -13
README.md CHANGED
@@ -5,7 +5,6 @@ tags:
5
  - food
6
  - reranking
7
  - sequence-classification
8
- - text-classification
9
  library_name: transformers
10
  pipeline_tag: text-classification
11
  license: mit
@@ -13,25 +12,41 @@ license: mit
13
 
14
  # Food Re-ranker Model
15
 
16
- This is a fine-tuned DistilBERT model trained for re-ranking food descriptions based on semantic similarity. The model is optimized for matching food item descriptions in a nutrition and diet tracking context.
17
 
18
- ## Model Description
19
 
20
- - **Base Model**: DistilBertForSequenceClassification
21
- - **Training Data**: Food description pairs with binary labels for matching/non-matching
22
- - **Task**: Binary classification to determine if two food descriptions refer to the same item
 
23
  - **Output**: Binary classification scores (0 = different foods, 1 = same food)
24
 
25
- ## Use Case
 
 
 
 
 
 
26
 
27
- This model is designed to improve food search accuracy by re-ranking initial search results. It takes pairs of food descriptions and determines their semantic similarity, helping to surface the most relevant matches.
28
 
29
- ## Training
 
 
 
 
30
 
31
- The model was trained on carefully curated food description pairs with binary classification:
32
- - Label 1: Pairs of descriptions that refer to the same food item
33
- - Label 0: Pairs of descriptions that refer to different food items
34
- - Uses cross-entropy loss for binary classification
 
 
 
 
 
35
 
36
  ## Example Usage
37
 
@@ -50,3 +65,4 @@ inputs = tokenizer(query, candidate, padding=True, truncation=True, return_tenso
50
  # Get prediction
51
  outputs = model(**inputs)
52
  score = outputs.logits.softmax(dim=1)[0][1].item() # Score for positive class
 
 
5
  - food
6
  - reranking
7
  - sequence-classification
 
8
  library_name: transformers
9
  pipeline_tag: text-classification
10
  license: mit
 
12
 
13
  # Food Re-ranker Model
14
 
15
+ This is a fine-tuned DistilBERT model trained for binary classification of food description pairs. The model determines whether two food descriptions refer to the same item, enabling accurate re-ranking of search results.
16
 
17
+ ## Model Details
18
 
19
+ ### Model Description
20
+ - **Base Model**: distilbert-base-uncased
21
+ - **Model Type**: distilbert
22
+ - **Task**: Binary classification (food description matching)
23
  - **Output**: Binary classification scores (0 = different foods, 1 = same food)
24
 
25
+ ### Architecture
26
+ - **Hidden Dimension**: 768
27
+ - **Number of Layers**: 6
28
+ - **Number of Attention Heads**: 12
29
+ - **Intermediate Size**: 3072
30
+ - **Maximum Position Embeddings**: 512
31
+ - **Vocabulary Size**: 30522
32
 
33
+ ## Use Case
34
 
35
+ Designed for improving food search accuracy by re-ranking initial search results, this model:
36
+ - Takes pairs of food descriptions as input
37
+ - Determines if they refer to the same food item
38
+ - Enables more accurate matching of food descriptions
39
+ - Helps surface the most relevant matches in search results
40
 
41
+ ## Training Configuration
42
+ - **Batch Size**: 32
43
+ - **Learning Rate**: 5e-05
44
+ - **Number of Epochs**: 3
45
+ - **Warmup Steps**: 0
46
+ - **Weight Decay**: 0.0
47
+ - **Dropout**: 0.1
48
+ - **Attention Dropout**: 0.1
49
+ - **Classification Dropout**: 0.2
50
 
51
  ## Example Usage
52
 
 
65
  # Get prediction
66
  outputs = model(**inputs)
67
  score = outputs.logits.softmax(dim=1)[0][1].item() # Score for positive class
68
+ ```