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
AGENT hello this is steve can i ask what's your name | |
CUSTOMER my name is harry | |
AGENT thanks harry. how can i help you |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 random | |
import string | |
def generate_random_userids(num_ids): | |
passwords = [] | |
for _ in range(num_ids): | |
password = ''.join(random.choices(string.ascii_letters + string.digits, k=12)) | |
passwords.append(password) | |
return passwords |
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
from huggingface_hub import HfApi | |
from huggingface_hub import duplicate_space | |
from huggingface_hub import hf_hub_download | |
from dotenv import load_dotenv | |
import os | |
# create a local .env file with HF_TOKEN (HF Hub Token) | |
load_dotenv() | |
HF_TOKEN = os.environ.get("HF_TOKEN") |
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
function toggle(id) { | |
var x = document.getElementById(id); | |
if (id == "a"){ | |
reset("b") | |
}else{ | |
reset("a") | |
} | |
if (x.style.display === "none") { | |
x.style.display = "block"; | |
} else { |
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
# Prodigy v1.11.x; some imports will change for v1.12+ | |
import copy | |
from pathlib import Path | |
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union | |
import srsly | |
from spacy.language import Language | |
from spacy.tokens import Doc, Span, Token | |
from spacy.util import filter_spans |
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 json | |
from typing import List | |
import srsly | |
import typer | |
app = typer.Typer() | |
def convert_to_coco(input_file: str, output_file: str): | |
# Load the JSONL file using srsly |
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
{"text":"How Silicon Valley Pushed Coding Into American Classrooms","meta":{"source":"The New York Times","i":0}} | |
{"text":"Women in Tech Speak Frankly on Culture of Harassment","meta":{"source":"The New York Times","i":1}} | |
{"text":"Silicon Valley Investors Flexed Their Muscles in Uber Fight","meta":{"source":"The New York Times","i":2}} | |
{"text":"Uber is a Creature of an Industry Struggling to Grow Up","meta":{"source":"The New York Times","i":3}} | |
{"text":"\u2018The Internet Is Broken\u2019: @ev Is Trying to Salvage It","meta":{"source":"The New York Times","i":4}} | |
{"text":"The South Park Commons Fills a Hole in the Tech Landscape","meta":{"source":"The New York Times","i":5}} | |
{"text":"The Closing of the Republican Mind","meta":{"source":"The New York Times","i":6}} | |
{"text":"Writers From the Right and Left on Trump Jr., the Future of the F.B.I., Health Care and More","meta":{"source":"The New York Times","i":7}} | |
{"text":"Daily Report: From Lean to Fat Start-Ups","meta":{"source":"The New York Times","i":8}} | |
{" |
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
{"text":"Biomaterials and medical devices are broadly used in the diagnosis, treatment, repair, replacement or enhancing functions of human tissues or organs. Although the living conditions of human beings have been steadily improved in most parts of the world. ","label":"ID: 27047681","spans":[{ "start": 0, "end": 12, "label": "ORG" },{ "start": 0, "end": 12, "label": "ORG_2" }]} |
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
from typing import List, Optional | |
import spacy | |
import prodigy | |
from prodigy.components.loaders import JSONL | |
from prodigy.components.preprocess import add_tokens | |
from prodigy.models.matcher import PatternMatcher | |
from prodigy.util import split_string | |
# Helper function for removing token information from examples |