View recipe.py
This file contains 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 | |
from typing import List, Optional, Union, Iterable | |
from prodigy.components.loaders import get_stream | |
from prodigy.components.preprocess import fetch_media as fetch_media_preprocessor | |
from prodigy.util import log, msg, get_labels, split_string | |
from prodigy.types import TaskType, RecipeSettingsType | |
def remove_base64(examples: List[TaskType]) -> List[TaskType]: |
View benchmark.py
This file contains 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 timeit | |
import requests | |
import html_text | |
import justext | |
from selectolax.parser import HTMLParser | |
# There's a difference between these two | |
html_long = requests.get("http://planet.python.org/").content.decode("utf-8") | |
html_short = "<p><b>This</b> is just a small example.</p>" |
View demo.py
This file contains 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 spacy | |
from spacy import displacy | |
def show_results(text, patterns): | |
nlp = spacy.blank("en") | |
ruler = nlp.add_pipe("entity_ruler") | |
ruler.add_patterns(patterns) | |
doc = nlp(text) |
View make_patterns.py
This file contains 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
""" | |
This script combines two datasets to generate a file with all found patterns. | |
""" | |
import srsly | |
from prodigy.components.db import connect | |
import spacy | |
nlp = spacy.blank("en") |
View recipe.py
This file contains 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 time | |
from typing import List | |
from rich import box | |
from rich.table import Table | |
from rich.console import Console | |
import prodigy | |
from prodigy.components.loaders import CSV |
View build_instructions.py
This file contains 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 base64 | |
import pathlib | |
from jinja2 import Environment, FileSystemLoader, select_autoescape | |
env = Environment( | |
loader=FileSystemLoader("images"), | |
autoescape=select_autoescape() | |
) | |
template = env.get_template("instructions.template") |
View bionic.py
This file contains 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 pyphen | |
import prodigy | |
from prodigy.components.loaders import JSONL | |
from prodigy.components.db import connect | |
hyphenator = pyphen.Pyphen(lang="en_US") | |
def construct_html(text): | |
hyphend = hyphenator.inserted(text) |
View polars.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View before.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View resume.json
This file contains 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
{ | |
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", | |
"basics": { | |
"name": "Vincent D. Warmerdam", | |
"label": "Senior Data Professional & Research Advocate", | |
"image": "", | |
"email": "vincentwarmerdam@gmail.com", | |
"url": "https://koaning.io", | |
"summary": "", | |
"location": { |
NewerOlder