Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tomaz Bratanic tomasonjo

🏠
Working from home
View GitHub Profile
View docs_gds_keyword.csv
keyword mentions
graph 259
algorithm 188
node 127
neo4j graph 88
neo4j 76
View docs_keyword.csv
keyword mentions
node 1194
neo4j 983
clipboard 868
graph 596
java 537
View docs_pagerank.csv
score url pagerank
598.00 https://neo4j.com/developer/kb 38.593852
55.0 https://neo4j.com/graphconnect-2018 21.989673
21.0 https://neo4j.com/labs/apoc/4.4/graph-querying/node-querying 12.607568
21.0 https://neo4j.com/labs/apoc/4.3/graph-querying/node-querying 12.420046
70.0 https://neo4j.com/docs/operations-manual/5/reference/configuration-settings 12.392406
View docs_degree.csv
score url
598.0 https://neo4j.com/developer/kb
391.0 https://neo4j.com/developer-blog/tagged/neo4j
235.0 https://neo4j.com/developer-blog/tagged/graph-database
165.0 https://neo4j.com/graphgists/categories/web-amp-social
165.0 https://neo4j.com/graphgists/categories/finance
View docs_outside.csv
page links
http://localhost:7474 38
https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/tag/4.3.0.12 38
https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/tag/4.4.0.12 37
https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/quickstarts/text-analytics-sdk 37
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html 37
View embeddings.py
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
def generate_embeddings(text):
embeddings = model.encode(text)
return [float(x) for x in embeddings.tolist()]
View keyword_tokens.py
def extract_keywords(text):
"""
Extract keywords and construct them back from tokens
"""
result = list()
keyword = ""
for token in nlp(text):
if token['entity'] == 'I-KEY':
keyword += token['word'][2:] if \
token['word'].startswith("##") else f" {token['word']}"
View keyword.py
tokenizer = AutoTokenizer.from_pretrained("yanekyuk/bert-uncased-keyword-extractor")
model = AutoModelForTokenClassification.from_pretrained(
"yanekyuk/bert-uncased-keyword-extractor"
)
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
View ice_families.csv
last_name count
Frey 91
Targaryen 66
Stark 51
Lannister 30
Hightower 28
Velaryon 21
Baratheon 21
Greyjoy 19
Rivers 15
View ice_size.csv
componentId componentSize
5 785
457 19
111 12
938 11
193 10