Update inference
Browse files- README.md +4 -6
- src/prediction.py +6 -3
README.md
CHANGED
@@ -180,8 +180,7 @@ for text in generated:
|
|
180 |
|
181 |
Output:
|
182 |
```text
|
183 |
-
[TITLE]:
|
184 |
-
- 1: Macaroni and corn
|
185 |
[INGREDIENTS]:
|
186 |
- 1: 2 c. macaroni
|
187 |
- 2: 2 tbsp. butter
|
@@ -200,9 +199,8 @@ Output:
|
|
200 |
- 6: Cook and stir until thickened and bubbly.
|
201 |
- 7: Stir in corn and bacon.
|
202 |
- 8: Pour over macaroni and mix well.
|
203 |
-
|
204 |
-
[TITLE]:
|
205 |
-
- 1: Grilled provolone and bacon sandwich
|
206 |
[INGREDIENTS]:
|
207 |
- 1: 2 slices provolone cheese
|
208 |
- 2: 2 slices bacon
|
@@ -215,7 +213,7 @@ Output:
|
|
215 |
- 4: Top with the other slice of bread.
|
216 |
- 5: Heat a skillet over medium heat.
|
217 |
- 6: Place the sandwich in the skillet and cook until the cheese is melted and the bread is golden brown.
|
218 |
-
|
219 |
```
|
220 |
|
221 |
## Evaluation
|
|
|
180 |
|
181 |
Output:
|
182 |
```text
|
183 |
+
[TITLE]: Macaroni and corn
|
|
|
184 |
[INGREDIENTS]:
|
185 |
- 1: 2 c. macaroni
|
186 |
- 2: 2 tbsp. butter
|
|
|
199 |
- 6: Cook and stir until thickened and bubbly.
|
200 |
- 7: Stir in corn and bacon.
|
201 |
- 8: Pour over macaroni and mix well.
|
202 |
+
----------------------------------------------------------------------------------------------------------------------------------
|
203 |
+
[TITLE]: Grilled provolone and bacon sandwich
|
|
|
204 |
[INGREDIENTS]:
|
205 |
- 1: 2 slices provolone cheese
|
206 |
- 2: 2 slices bacon
|
|
|
213 |
- 4: Top with the other slice of bread.
|
214 |
- 5: Heat a skillet over medium heat.
|
215 |
- 6: Place the sandwich in the skillet and cook until the cheese is melted and the bread is golden brown.
|
216 |
+
----------------------------------------------------------------------------------------------------------------------------------
|
217 |
```
|
218 |
|
219 |
## Evaluation
|
src/prediction.py
CHANGED
@@ -96,8 +96,11 @@ for text in generated:
|
|
96 |
section = section.replace("directions:", "")
|
97 |
headline = "DIRECTIONS"
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
102 |
|
103 |
print("-" * 130)
|
|
|
96 |
section = section.replace("directions:", "")
|
97 |
headline = "DIRECTIONS"
|
98 |
|
99 |
+
if headline == "TITLE":
|
100 |
+
print(f"[{headline}]: {section.strip().capitalize()}")
|
101 |
+
else:
|
102 |
+
section_info = [f" - {i+1}: {info.strip().capitalize()}" for i, info in enumerate(section.split("--"))]
|
103 |
+
print(f"[{headline}]:")
|
104 |
+
print("\n".join(section_info))
|
105 |
|
106 |
print("-" * 130)
|