Skip to content

Instantly share code, notes, and snippets.

@wesslen
Last active May 11, 2022 14:22
Show Gist options
  • Select an option

  • Save wesslen/4387ac02844f30f279e53790c7d00958 to your computer and use it in GitHub Desktop.

Select an option

Save wesslen/4387ac02844f30f279e53790c7d00958 to your computer and use it in GitHub Desktop.
Prodigy mp4 api recipe
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