Last active
May 11, 2022 14:22
-
-
Save wesslen/4387ac02844f30f279e53790c7d00958 to your computer and use it in GitHub Desktop.
Prodigy mp4 api recipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import prodigy | |
| import requests | |
| def get_stream(): | |
| res = requests.get("https://owen-wilson-wow-api.herokuapp.com/wows/random?results=10").json() | |
| for i in res: | |
| movie = i["movie"] | |
| url = i["video"]["480p"] | |
| yield {"video": url, "text": movie} | |
| @prodigy.recipe( | |
| "owen_wow_recipe", | |
| dataset=("Dataset to save answers to", "positional", None, str), | |
| view_id=("Annotation interface", "option", "v", str) | |
| ) | |
| def owen_wow_recipe(dataset, view_id="audio"): | |
| stream = get_stream() | |
| return { | |
| "dataset": dataset, | |
| "view_id": view_id, | |
| "stream": stream | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment