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 anywidget | |
import traitlets | |
class TangleWidget(anywidget.AnyWidget): | |
_esm = """ | |
export default { render }; | |
function render({ model, el }) { | |
const input = document.createElement('span'); | |
input.style.borderBottom = '1px dashed #3498db'; |
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
pork chop noodle soup | |
5 ingredient almond cake with fresh berries | |
shrimp cakes | |
chili roasted okra | |
slow cooker chicken chili | |
fall superfood beef stew | |
rotisserie turkey breast tenderloin with pesto | |
j . alexander's mac and cheese | |
spinach stuffed pork roast | |
lasagna soup |
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
{ | |
"name": "NuPhy Air60 V2", | |
"vendorProductId": 435499605, | |
"macros": [ | |
"{+KC_LSFT}{+KC_LGUI} {-KC_LSFT}{-KC_LGUI}", | |
"{KC_LGUI} ", | |
"{+KC_LSFT} ", | |
"", | |
"", | |
"", |
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]: |
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>" |
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) |
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") |
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 |
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") |
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) |
NewerOlder