Skip to content

Instantly share code, notes, and snippets.

View cyberandy's full-sized avatar
:octocat:
Yo!

Andrea Volpini cyberandy

:octocat:
Yo!
View GitHub Profile
@cyberandy
cyberandy / wordlift-graphql-data-agent-powered-by-llamaindex-a-simple-demo.ipynb
Last active September 26, 2023 14:05
wordlift-graphql-data-agent-powered-by-llamaindex-a-simple-demo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"embeddings": [
{
"tensorName": "My tensor",
"tensorShape": [
1000,
50
],
"tensorPath": "https://gist.githubusercontent.com/cyberandy/d85af5a612c9763928542708c0ac0bf6/raw/b0c02e2f4324657ec7632e6a1e3cffc138e4a845/embeddings_vectors_porsche.tsv",
"metadataPath": "https://gist.githubusercontent.com/cyberandy/9a629edef01df3255d1e33b9875eadc9/raw/aab52346e227428ee1cf5d85dd4f7fbf2e227918/embeddings_meta_porsche.tsv"
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
0-100 porsche macan
0-60 porsche macan
1 porsche cayenne
1. porsche 911
1950s porsche
1950s porsche speedster
1955 porsche 356
1956 porsche 356
1956 porsche speedster
1959 porsche
@cyberandy
cyberandy / embeddings_vectors_porsche.tsv
Created December 15, 2021 13:55
embeddings_vectors_porsche
We can't make this file beautiful and searchable because it's too large.
{
"embeddings": [
{
"tensorName": "My tensor",
"tensorShape": [
1000,
50
],
"tensorPath": "https://gist.githubusercontent.com/cyberandy/f40e161d69188df7d5a901b50a64f0fe/raw/674f5c78a0c33d6b6a3da4d726ef918938d4bd68/embeddings_projectors.tsv",
"metadataPath": "https://gist.githubusercontent.com/cyberandy/092f00976a842497a113280197cb61d7/raw/6aab7043891897269c5c35df81f878e4e0a040b1/embeddings_meta.tsv"
@cyberandy
cyberandy / embeddings_meta.tsv
Last active December 8, 2021 15:16
KG embeddings meta
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
wl0216/entity/artificial_intelligence
wl0216/entity/gennaro_cuofano
wl0216/entity/google
wl0216/entity/google_analytics
wl0216/entity/how_to_optimize_your_website_for_voice_search
wl0216/entity/json-ld
wl0216/entity/knowledge_graph
wl0216/entity/metadata
wl0216/entity/microdata_html
wl0216/entity/natural_language_processing
@cyberandy
cyberandy / embeddings_projectors.tsv
Last active December 8, 2021 15:13
KG embeddings WordLift Blog
We can't make this file beautiful and searchable because it's too large.
@cyberandy
cyberandy / lodgingbusiness-wordlift-markup
Last active March 24, 2023 06:47
Example of a JSON-LD for LodgingBusiness that WordLift produces
[
{
"@context": "http://schema.org",
"@id": "http://data.wordlift.io/[entity-name]",
"@type": ["LodgingBusiness"],
"description": "Here goes the description",
"mainEntityOfPage": "https://www.happywordliftclient.com",
"image": [
{ "@type": "ImageObject", "url": "https://www.happywordliftclient.com/wp-content/uploads/2011/07/img-19az-1200x675.jpg", "width": 1200, "height": 675 },
{ "@type": "ImageObject", "url": "https://www.happywordliftclient.com/wp-content/uploads/2011/07/img-19az-1200x900.jpg", "width": 1200, "height": 900 },
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://wordlift.io/blog/en/#website",
"type": "http://schema.org/WebSite",
"http://schema.org/alternateName": "SEO made simple",
"http://schema.org/name": "WordLift Blog",
"http://schema.org/potentialAction": {
"type": "http://schema.org/SearchAction",
"http://schema.org/query-input": "required name=search_term_string",
"http://schema.org/target": "https://wordlift.io/blog/en/?s={search_term_string}"
import requests
from bs4 import BeautifulSoup
import time
USER_AGENT = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'}
def fetch_results(search_term, number_results, language_code):
assert isinstance(search_term, str), 'Search term must be a string'
assert isinstance(number_results, int), 'Number of results must be an integer'