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
let url = "https://www.amazon.com/SanDisk-128GB-microSDXC-Memory-Adapter/dp/B073JYC4XM/"; | |
let kwparse = (url.replace('https://','').replace('http://','').replace('www','').replace('com','').split('-').join().split('/').join().split('.')).join(',').replace(/^,/, '') | |
let kwuniq = [...new Set(kwparse.split(','))].filter(function(e){return e}); | |
console.log(kwuniq) | |
// ["amazon", "SanDisk", "128GB", "microSDXC", "Memory", "Adapter", "dp", "B073JYC4XM"] | |
// Hat Tip - Find a cleaner version at https://gist.github.com/dsottimano/52060e6a43d96804f33c59366c472305 |
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
# Scrape Shopify themes using scrapy.org | |
#!pip install scrapy | |
#%%writefile shopify_theme_spider.py | |
import scrapy | |
class ShopifyThemeSpider(scrapy.Spider): | |
name = 'bshopifyspider' | |
start_urls = ['https://themes.shopify.com/themes?page=1'] |
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 ConnectButton(){ | |
console.log("Connect pushed"); | |
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click() | |
} | |
setInterval(ConnectButton,60000); |
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 asyncio | |
import streamlit as st | |
from httpx_oauth.clients.google import GoogleOAuth2 | |
st.title("Google OAuth2 flow") | |
"## Configuration" | |
client_id = st.text_input("Client ID") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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
""" | |
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
"""Hack to add per-session state to Streamlit. | |
Usage | |
----- | |
>>> import SessionState | |
>>> | |
>>> session_state = SessionState.get(user_name='', favorite_color='black') | |
>>> session_state.user_name | |
'' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.