# Ingredients errors

**URL:** <https://forum.openfoodfacts.org/t/ingredients-errors/395>\
**Category:** Database\
**Created:** [September 24, 2023, 11:13am UTC](https://forum.openfoodfacts.org/t/ingredients-errors/395 "2023-09-24T11:13:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlesnepote](https://forum.openfoodfacts.org/user_avatar/forum.openfoodfacts.org/charlesnepote/32/8_2.png) [@charlesnepote](https://forum.openfoodfacts.org/u/charlesnepote)\
**Post date:** [September 24, 2023, 11:13am UTC](https://forum.openfoodfacts.org/t/ingredients-errors/395/1 "2023-09-24T11:13:39Z")

</div>

We already have many data quality **warnings** about ingredients, but there are producing many false positives. We should try to find real issues in order to fix them.

We can probably identify two cases.

## 1. Ingredients with real issues

These ingredients should be identified and manually fixed. We should try to list some ingredients that contain issues.

### a. Typos

- bceuf instead of boeuf, and ceuf instead of oeuf (this [query](https://mirabelle.openfoodfacts.org/products?sql=--+Search+for+%22ceuf%22+%28ceuf%2C+bceuf%29+in+the+ingredients+%28OCR+mistakes+for+oeuf+or+boeuf%29%0D%0Aselect+code%2C+url%0D%0A%2C+ingredients_text%0D%0A%2C+regexp_substr%28ingredients_text%2C+%22%28.%7B10%7D%29%3F.%3Fceuf.%7B1%2C10%7D%22%29+as+sub%0D%0Afrom+%5Ball%5D%0D%0Awhere+ingredients_text+REGEXP+%22%28.%7B10%7D%29%3F.%3Fceuf.%7B1%2C10%7D%22%0D%0Aorder+by+sub%0D%0Alimit+30000) gives 800+ results)
- sečer/šecer/secer/sećer/šečer instead of šećer (found 25 times (~3000 products in HR) [https://hr.openfoodfacts.org/product/3859889283694](https://hr.openfoodfacts.org/product/3859889283694), [https://hr.openfoodfacts.org/product/3850116039855](https://hr.openfoodfacts.org/product/3850116039855), …)

### b. Words which are not ingredients

- `l.l.c.`, `gmbh`, `gaec`, etc. (this [query](https://mirabelle.openfoodfacts.org/products?sql=--+Find+products+with+ingredients+containing+%22gaec%22+or+%22l.l.c%22+or+%22gmbh%22%2C+etc.%2C+which+should+trigger+an+issue%0D%0Aselect+code%2C+url%2C+countries_tags%2C+ingredients_text%0D%0A%2C+regexp_substr%28lower%28ingredients_text%29%2C+%22%28.%7B10%7D%29%3F.%3F%28gaec%7Cl%5C.%3Fl%5C.%3Fc%7Cgmbh%29%28.%7B1%2C10%7D%29%3F%22%29+as+sub%0D%0Afrom+%5Ball%5D%0D%0Awhere+true+and%0D%0Alower%28ingredients_text%29+REGEXP+%22gaec%7Cl%5C.%3Fl%5C.%3Fc%7Cgmbh%22%0D%0Aorder+by+sub%0D%0Alimit+1000) returns 2200+ products)
- Ingredients beginning by `Ingredients` or `ING:`, `INGREDIENTS / INGREDIENTES: `, etc.
- `à conserver`, `store`, … (this [query](https://mirabelle.openfoodfacts.org/products?sql=--+Find+products+with+ingredients+containing+%22conserver%22+or+%22store%22%0D%0Aselect+code%2C+url%2C+countries_tags%2C+ingredients_text%0D%0A%2C+regexp_substr%28lower%28ingredients_text%29%2C+%22%28.%7B10%7D%29%3F.%3F%28conserver%7Cstore%29%28.%7B1%2C10%7D%29%3F%22%29+as+sub%0D%0Afrom+%5Ball%5D%0D%0Awhere+true+and%0D%0Alower%28ingredients_text%29+REGEXP+%22conserver%7Cstore%22%0D%0Aorder+by+sub%0D%0Alimit+1000) returns more than 7400 products)
  - Add a stopword?

- `made in`, `fabriqué`, …
- `Kann bei übermäßigem Verzehr abführend wirken` (meaning: Can have a laxative effect if consumed to excess)
- [to be continued]

## 2. Ingredients to be deleted

The whole `ingredients` field should be deleted because it is too “noisy”: maybe few words are ok, but the rest is full of mistakes. We should try to identify patterns based on examples.

In this case, we could automatically delete the ingredients.

### Examples

- [Steam in bag baby red potatoes version 12](https://world.openfoodfacts.org/product/0033383004587/steam-in-bag-baby-red-potatoes?rev=12)

### Patterns

- a. Ingredients only containing [a sequence of one to 5 chars repeated at least 3 times](https://mirabelle.openfoodfacts.org/products?sql=--+Find+products+with+ingredients+only+containing+a+sequence+of+one+to+5+chars+repeated+at+least+3+times%0D%0Aselect+code%2C+url%2C+countries_tags%2C+ingredients_text%0D%0Afrom+%5Ball%5D%0D%0Awhere+true+and%0D%0Alower%28ingredients_text%29+REGEXP+%22%5E%28..%3F.%3F.%3F.%3F%29%5C1%7B2%2C%7D%24%22%0D%0Aorder+by+ingredients_text%0D%0Alimit+1000)
- b. Ingredients containing a specific letter repeated more than 4 times: no language at all should contain an alphabetic letter repeated more than 4 times
- c. Ingredients containing [only non-alphanumeric signs](https://mirabelle.openfoodfacts.org/products?sql=--+Find+products+with+ingredients+only+containing+non+alphanumeric+chars%0D%0Aselect+code%2C+url%2C+countries_tags%2C+ingredients_text%0D%0Afrom+%5Ball%5D%0D%0Awhere+true+%0D%0Aand+ingredients_text+%21%3D+%22%22%0D%0Aand+regexp_like+%28lower%28ingredients_text%29%2C+%22%5E%5B%5E%5Cw%5D*%24%22%29%0D%0A--+and+lower%28ingredients_text%29+REGEXP+%22%5E%5B%5E%5Cw%5D*%24%22+--+this+REGEXP+module+does+not+take+extra+latin+chars+into+account%0D%0Aorder+by+ingredients_text%0D%0Alimit+1000).
- d. Ingredients containing mostly non-alphanumeric signs.
- e. Ingredients [only containing one latin char or diacritic sign](https://mirabelle.openfoodfacts.org/products?sql=--+Find+products+with+ingredients+only+containing+one+latin+char+or+diacritic+sign%0D%0Aselect+code%2C+url%2C+countries_tags%2C+ingredients_text%0D%0Afrom+%5Ball%5D%0D%0Awhere+true+%0D%0Aand+ingredients_text+%21%3D+%22%22%0D%0Aand+regexp_like+%28lower%28ingredients_text%29%2C+%22%5E%5Ba-z0-9_%26%C3%A9%7E%23%27%5C%28%5C%5B%5C-%7C%C3%A8%60%5C%5C%C3%A7%5E%C3%A0%40%29%C2%B0%5C%29%5C%5D%5C%2B%3D%7D%C2%A3%C2%A8%25%C3%B9%C2%B5*%21%C2%A7%3A%2F%3B%5C.%2C%3C%3E%5Ct%5Cn%5Cr%5Cf%5Ca%5Ce%5Cs%5D%24%22%29%0D%0Aorder+by+ingredients_text%0D%0Alimit+1000)
- f. [to be continued]
