-
jq — https://jqlang.github.io/jq/ — "like sed for JSON data"
There are several options available for installing jq. I prefer to use Homebrew:
brew install jq
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
# pip3 install openai | |
import openai | |
import time | |
OPENAI_API_KEY = "your_api_key_here" | |
openai.api_key = OPENAI_API_KEY | |
prompt = """French: La semaine dernière, quelqu’un m’a fait part de sa gratitude envers notre travail. |
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 os | |
from .app import start_cli_service | |
env = (os.environ.get("env") or "prod").lower() | |
is_dev = env == "dev" or env == "local" | |
port, autoreload_observer = start_cli_service(autoreload=is_dev) | |
if autoreload_observer: | |
# move autoreload observer to the foreground so process won't exit |
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 React, {useEffect, useRef, useState} from 'react'; | |
import { Switch, Flex, Text } from '@chakra-ui/react'; | |
import UplotReact from 'uplot-react'; | |
import { toast } from 'react-toastify'; | |
import 'uplot/dist/uPlot.min.css'; | |
const colors = [ | |
'#007BFF', | |
'#FFA62B', |
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 streamlit as st | |
from persist import persist, load_widget_state | |
def main(): | |
if "page" not in st.session_state: | |
# Initialize session state. | |
st.session_state.update({ | |
# Default page. | |
"page": "home", |
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
""" | |
Example of a Streamlit app for an interactive Prodigy dataset viewer that also lets you | |
run simple training experiments for NER and text classification. | |
Requires the Prodigy annotation tool to be installed: https://prodi.gy | |
See here for details on Streamlit: https://streamlit.io. | |
""" | |
import streamlit as st | |
from prodigy.components.db import connect | |
from prodigy.models.ner import EntityRecognizer, merge_spans, guess_batch_size |
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 logging | |
import numpy as np | |
import tensorflow as tf | |
from tensorflow.contrib import layers | |
GO_TOKEN = 0 | |
END_TOKEN = 1 | |
UNK_TOKEN = 2 |
This example pulls together various examples of work with trees in D3.js. See the d3js Tree Visualizer live here.
The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.
One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.
Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.
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
#!/usr/bin/python2 | |
import logging | |
import sys | |
import couchdb | |
import json | |
from libgreader import GoogleReader, ClientAuthMethod, Feed | |
""" | |
Original can be obtained here: https://gist.github.com/Nazgolze/5479539 |
NewerOlder