File size: 1,073 Bytes
93d9855
 
3463fda
 
 
93d9855
3463fda
409e072
a4ee1c4
3463fda
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
license: mit
library_name: spacy
tags:
- food
---
# Food NER
Github Repo: <a href=https://github.com/randymi01/food_ner> https://github.com/randymi01/food_ner</a>

Spacy Food Name Entity Recognition (NER) model trained on StanfordNLP CRF recipe dataset

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install spacy version spacy==3.5.0 and then download the spacy en_core_web_sm model.

```bash
pip install spacy==3.5.0
python -m spacy download en_core_web_sm
```

## Usage

```python
import spacy

nlp = spacy.load("model")

# returns (spring mix, chicken breast, chili, hamburger meat)
nlp("I have spring mix, chicken breast, chili, and hamburger meat").ents

```

## Model Hyperparameters 
* Epochs: 10
* Batch Size: 4-32
* Optimizer: Adam
* lr = 5e-03
* drop_rate = 0.5

## Model Performance
![alt text](https://github.com/randymi01/food_ner/blob/main/training_loss.png?raw=true)
![alt text](https://github.com/randymi01/food_ner/blob/main/validation_loss.png?raw=true)

## License

[MIT](https://choosealicense.com/licenses/mit/)