If you are not working with React and JSX, this could be a quick way to embed html inside Javascript...
Tuesday, November 29, 2016
Sunday, November 13, 2016
Food Recipes: Semantic representation, Formal Language and Visualization
I always enjoyed the precision that programming languages commands give instructions to computers and I have been wondering if that precision could be applied to food recipes.
If computers could understand semantically a recipe, they would be able to perform many interesting tasks.
For example a computer could
Other formats:
Video could also be used. Animation could fit better because could be generated in CG. I personally like this point of view in recipe video:
And as a final note, this is a video of my mother that I took several years ago. Not a good example of clarity but... a good recipe:
If computers could understand semantically a recipe, they would be able to perform many interesting tasks.
For example a computer could
- Scale the recipe: Not only multiplying ingredients but also adjusting the time and the difficulty
- Merge recipes fitting one into another taking advantage of the idle moments. It would be possible to plan several recipes with a certain deadline. Something like "I want to prepare Risotto alle Fragole and Arista for 3 people and everything should be ready by 7 pm". This is as example of simplified merging process:
- Combine recipes to come out with new variation. There is the "Computer Cooking Contest" that is trying to achieve this result. The event is organised every year, see in the resources section for links.
- Using a version control system, such as Git, where could have people to add variations of the recipe creating branch, merging, committing, etc.
- Computers could, with the help of a machine or robot, cook for you
Visualization
If the recipe is semantically represented inside the computer, it could be automatically visualised using some algorithm. A viable format could be similar to:Other formats:
Video could also be used. Animation could fit better because could be generated in CG. I personally like this point of view in recipe video:
Resources
A method for extracting major workflow composed of ingredients, tools, and actions from cooking procedural text
By Yoko Yamakata, Shinji Imahori, Hirokuni Maeta, Shinsuke Mori (2016)
A method for extracting a major workflow of cooking procedure from a Japanese recipe on the Web. It is utilized for various applications including recipe search, summarization, and visualization.
http://www.ar.media.kyoto-u.ac.jp/publications/yamakata-CEA16.pdfTraining the PR2 in Culinary Arts. A Natural Language Model for Parsing Recipes
By Jessica Zhao, Alejandro Bordallo, Subramanian Ramamoorthy (2016)
a culinary language model for the kitchen by abstracting cooking instructions into a generalized tripartite form of ACTION, TARGET, TOOL.
http://stanford.edu/~jesszhao/files/PR2cooking.pdfPredicting the Structure of Cooking Recipes
By Jermsak Jermsurawong and Nizar Habash (2015)
An ingredient-instruction dependency tree data structure to represent recipes. The proposed representation allows for more refined comparison of recipes and recipe - parts, and is a step towards semantic representation of recipes
http://www.aclweb.org/anthology/D/D15/D15-1090.pdfFlow Graph Corpus from Recipe Texts
By Shinsuke Mori, Hirokuni Maeta, Yoko Yamakata, Tetsuro Sasada4 (2015)
An attempt at annotating procedural texts with a flow graph as a representation of understanding.The domain we focus on is cooking recipe.
https://pdfs.semanticscholar.org/7f88/398e8928d32366ebf725eb457cb2fa3a94bf.pdf
Monday, November 7, 2016
10 Criterias to Judge a Good Milk Container
#1 Openability |
BAD
This container is difficult to open. It require, at first to remove the blue cap. Then there is a small handle that need to be pulled. Sometime it breakes and the pulling action, due to the strenght required, may make you spill some milk |
GOOD
This container is Easy to open knowing the method. Can be opened with two single steps using one hand while the other hold the bottle. The moviment are slow and would not cause any spill |
---|---|---|
#2 Closability |
BAD
The cup net to be screwed to close so it requires some work. It is a separate object that can get lost. It doesn't seal the container ermetically but it gives the false impression that it does so someone may try to store it horizzontally causing milk to spill |
GOOD
To close the container it is enough to fold it back. It doesn't seal ermetically but it is close enough |
Tuesday, November 1, 2016
GPS nmea GPX (or KLM) converter for Google Maps
This script take large amount of GPS data in nmea format and convert into gpx format to import into Google maps.
I had large amount of data coming from a trip to Iceland and I wanted quicly import it on Google My Maps.
Google has a limit of 5 MB but my data was 90 MB.
To reduce the data the script
There are two variables that you can adjust to get an putput file smaller than 5 MB. In my case the best compromise was
This generate an ouput file of 4,5 MB
Using instead
The output file was 6 MB
The output files are in the folder data.
I had large amount of data coming from a trip to Iceland and I wanted quicly import it on Google My Maps.
Google has a limit of 5 MB but my data was 90 MB.
To reduce the data the script
- only export latitude and longitude
- approximae the latitude and longitude values reducing the number of decimal digit
- skeep points
There are two variables that you can adjust to get an putput file smaller than 5 MB. In my case the best compromise was
- savePointsEvery = 4
- precision = 6
This generate an ouput file of 4,5 MB
Using instead
- savePointsEvery = 4
- precision = 6
The output file was 6 MB
The output files are in the folder data.
Source
Find the source at https://github.com/lucamug/gps-converterExample
This is the result after imported in Google Maps:
Subscribe to:
Posts
(
Atom
)