Skip to content

Instantly share code, notes, and snippets.

@nathankjer
nathankjer / word2vec-pathfinding.py
Created January 19, 2023 04:20
Code to implement pathfinding between two latent word vectors.
import heapq
class elem_t:
def __init__(self,value,parent=None,cost=None):
self.value = value
self.cost = cost
self.column_offset = 0
self.parent = parent
class PriorityQueue:
@nathankjer
nathankjer / wiki_category_years.txt
Created August 23, 2016 21:09
Year of Wikipedia categories based on linearly-regressed examples, of word2vecs trained on co-occurrences.
This file has been truncated, but you can view the full file.
793 Year_of_birth_unknown
841 Medieval_child_rulers
896 Monarchs_killed_in_action
896 Murdered_monarchs
910 Year_of_death_unknown
913 Orthodox_monarchs
942 12th-century_births
966 Christians_of_the_Crusades
986 Popes
988 11th-century_Roman_Catholic_bishops
@nathankjer
nathankjer / wiki_category_decades.txt
Last active August 23, 2016 22:35
Decades of Wikipedia categories based on logistically-classified examples, of word2vecs trained on co-occurrences.
1770 Documents_of_the_American_Revolution
1770 New_York_in_the_American_Revolution
1790 1796_establishments_in_New_York
1790 1799_events_of_the_French_Revolution
1810 1810_establishments_in_Ohio
1810 1811_establishments_in_Indiana_Territory
1810 1818_establishments_in_Indiana
1810 1818_establishments_in_Ohio
1810 Pre-statehood_history_of_Illinois
1810 Southwestern_Indiana
@nathankjer
nathankjer / wiki_category_centuries.txt
Last active August 23, 2016 22:42
Century of Wikipedia categories based on logistically-classified examples, of word2vecs trained on co-occurrences.
1800 1806_births
1800 1812_births
1800 1815_births
1800 1816_establishments_in_Ohio
1800 1817_births
1800 1817_establishments_in_the_United_States
1800 1818_establishments_in_Ohio
1800 1821_births
1800 1822_births
1800 1824_establishments_in_Alabama