Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -56,7 +56,7 @@ model.config.use_cache = True
|
|
| 56 |
model.eval()
|
| 57 |
```
|
| 58 |
|
| 59 |
-
###Return the nutrient values for an example recipe: ###
|
| 60 |
```python
|
| 61 |
system_prompt = ""
|
| 62 |
user_prompt = "Compute the nutrient values per 100 grams in a recipe with the following ingredients: 250 g cream, whipped, cream topping, pressurized, 250 g yogurt, greek, plain, nonfat, 50 g sugars, powdered"
|
|
@@ -79,9 +79,9 @@ answers = tokenizer.batch_decode(generated_ids[:, inputs['input_ids'].shape[1]:]
|
|
| 79 |
answers = [x.split('<|eot_id|>')[0].strip() for x in answers]
|
| 80 |
print(answers[0])
|
| 81 |
```
|
| 82 |
-
###Expected answer: Nutrient values per 100 g highlighted: energy - 134.24, fat - 5.78, protein - 7.51, salt - 0.06, saturates - 3.58, sugars - 13.00 ###
|
| 83 |
|
| 84 |
-
###Classifying recipes by traffic light nutrition labels: ###
|
| 85 |
```python
|
| 86 |
user_prompt = "Review the fsa traffic lights per 100 grams in a recipe using the following ingredients: 1/2 cup soup, swanson chicken broth 99% fat free, 1 pinch salt, table"
|
| 87 |
|
|
@@ -104,9 +104,9 @@ answers = [x.split('<|eot_id|>')[0].strip() for x in answers]
|
|
| 104 |
print(answers[0])
|
| 105 |
```
|
| 106 |
|
| 107 |
-
###Expected answer: Food Standards Agency lights in each 100 g: fat - green, salt - red, saturates - green, sugars - green ###
|
| 108 |
|
| 109 |
-
###Extract food named entities: ###
|
| 110 |
```python
|
| 111 |
user_prompt = "Retrieve all food entities referenced in the text: Line a large colander with a cheesecloth. Stir salt into the yogurt, and pour the yogurt into the cheesecloth. Set the colander in the sink or bowl to catch the liquid that drains off. Leave to drain for 24 hours. After draining for the 24 hours, transfer the resulting cheese to a bowl. Stir in the olive oil. Store in a covered container in the refrigerator."
|
| 112 |
messages = [
|
|
@@ -127,9 +127,9 @@ answers = tokenizer.batch_decode(generated_ids[:, inputs['input_ids'].shape[1]:]
|
|
| 127 |
answers = [x.split('<|eot_id|>')[0].strip() for x in answers]
|
| 128 |
print(answers[0])
|
| 129 |
```
|
| 130 |
-
###Expected answer: Indeed, the entities concerning food are outlined below: salt, yogurt, liquid, cheese, olive oil. ###
|
| 131 |
|
| 132 |
-
###Link named entities to the SNOMEDCT ontology: ###
|
| 133 |
```python
|
| 134 |
user_prompt = "Link the following food entities to a SNOMEDCT ontology: cream cheese, meat"
|
| 135 |
messages = [
|
|
@@ -150,4 +150,4 @@ answers = tokenizer.batch_decode(generated_ids[:, inputs['input_ids'].shape[1]:]
|
|
| 150 |
answers = [x.split('<|eot_id|>')[0].strip() for x in answers]
|
| 151 |
print(answers[0])
|
| 152 |
```
|
| 153 |
-
###Expected answer: Indeed, the entities are connected in this fashion: cream cheese - http://purl.bioontology.org/ontology/SNOMEDCT/226849005;http://purl.bioontology.org/ontology/SNOMEDCT/255621006;http://purl.bioontology.org/ontology/SNOMEDCT/102264005, meat - http://purl.bioontology.org/ontology/SNOMEDCT/28647000. ###
|
|
|
|
| 56 |
model.eval()
|
| 57 |
```
|
| 58 |
|
| 59 |
+
### Return the nutrient values for an example recipe: ###
|
| 60 |
```python
|
| 61 |
system_prompt = ""
|
| 62 |
user_prompt = "Compute the nutrient values per 100 grams in a recipe with the following ingredients: 250 g cream, whipped, cream topping, pressurized, 250 g yogurt, greek, plain, nonfat, 50 g sugars, powdered"
|
|
|
|
| 79 |
answers = [x.split('<|eot_id|>')[0].strip() for x in answers]
|
| 80 |
print(answers[0])
|
| 81 |
```
|
| 82 |
+
### Expected answer: Nutrient values per 100 g highlighted: energy - 134.24, fat - 5.78, protein - 7.51, salt - 0.06, saturates - 3.58, sugars - 13.00 ###
|
| 83 |
|
| 84 |
+
### Classifying recipes by traffic light nutrition labels: ###
|
| 85 |
```python
|
| 86 |
user_prompt = "Review the fsa traffic lights per 100 grams in a recipe using the following ingredients: 1/2 cup soup, swanson chicken broth 99% fat free, 1 pinch salt, table"
|
| 87 |
|
|
|
|
| 104 |
print(answers[0])
|
| 105 |
```
|
| 106 |
|
| 107 |
+
### Expected answer: Food Standards Agency lights in each 100 g: fat - green, salt - red, saturates - green, sugars - green ###
|
| 108 |
|
| 109 |
+
### Extract food named entities: ###
|
| 110 |
```python
|
| 111 |
user_prompt = "Retrieve all food entities referenced in the text: Line a large colander with a cheesecloth. Stir salt into the yogurt, and pour the yogurt into the cheesecloth. Set the colander in the sink or bowl to catch the liquid that drains off. Leave to drain for 24 hours. After draining for the 24 hours, transfer the resulting cheese to a bowl. Stir in the olive oil. Store in a covered container in the refrigerator."
|
| 112 |
messages = [
|
|
|
|
| 127 |
answers = [x.split('<|eot_id|>')[0].strip() for x in answers]
|
| 128 |
print(answers[0])
|
| 129 |
```
|
| 130 |
+
### Expected answer: Indeed, the entities concerning food are outlined below: salt, yogurt, liquid, cheese, olive oil. ###
|
| 131 |
|
| 132 |
+
### Link named entities to the SNOMEDCT ontology: ###
|
| 133 |
```python
|
| 134 |
user_prompt = "Link the following food entities to a SNOMEDCT ontology: cream cheese, meat"
|
| 135 |
messages = [
|
|
|
|
| 150 |
answers = [x.split('<|eot_id|>')[0].strip() for x in answers]
|
| 151 |
print(answers[0])
|
| 152 |
```
|
| 153 |
+
### Expected answer: Indeed, the entities are connected in this fashion: cream cheese - http://purl.bioontology.org/ontology/SNOMEDCT/226849005;http://purl.bioontology.org/ontology/SNOMEDCT/255621006;http://purl.bioontology.org/ontology/SNOMEDCT/102264005, meat - http://purl.bioontology.org/ontology/SNOMEDCT/28647000. ###
|