  import datetime
  import bz2
  from spacy.kb import KnowledgeBase
  
  # these will/should be matched ignoring case
  wiki_namespaces = ["b", "betawikiversity", "Book", "c", "Category", "Commons",
                     "d", "dbdump", "download", "Draft", "Education", "Foundation",
                     "Gadget", "Gadget definition", "gerrit", "File", "Help", "Image", "Incubator",
 
</s> remove     _read_wikipedia_prior_probs()
 </s> add     # STEP 1 : create prior probabilities from WP
    # run only once !
    # _read_wikipedia_prior_probs() </s> remove     # nlp = spacy.load('en_core_web_sm')
    # my_kb = create_kb(nlp.vocab)
 </s> add     # STEP 2 : create KB
    nlp = spacy.load('en_core_web_sm')
    my_kb = create_kb(nlp.vocab, max_entities_per_alias=10, min_occ=5) </s> remove def create_kb(vocab):
 </s> add def create_kb(vocab, max_entities_per_alias, min_occ): </s> remove     # _read_wikidata()
    _read_wikipedia()
 </s> add  </s> remove     # with bz2.open('C:/Users/Sofie/Documents/data/wikipedia/enwiki-20190320-pages-articles-multistream-index.txt.bz2', mode='rb') as file:
    with bz2.open('C:/Users/Sofie/Documents/data/wikipedia/enwiki-20190320-pages-articles-multistream.xml.bz2', mode='rb') as file:
 </s> add     with bz2.open(ENWIKI_DUMP, mode='rb') as file:
# TODO: remove hardcoded paths
WIKIDATA_JSON = 'C:/Users/Sofie/Documents/data/wikidata/wikidata-20190304-all.json.bz2'
ENWIKI_DUMP = 'C:/Users/Sofie/Documents/data/wikipedia/enwiki-20190320-pages-articles-multistream.xml.bz2'
ENWIKI_INDEX = 'C:/Users/Sofie/Documents/data/wikipedia/enwiki-20190320-pages-articles-multistream-index.txt.bz2'
PRIOR_PROB = 'C:/Users/Sofie/Documents/data/wikipedia/prior_prob.csv'


  import datetime
  import bz2
  from spacy.kb import KnowledgeBase
  
# TODO: remove hardcoded paths
WIKIDATA_JSON = 'C:/Users/Sofie/Documents/data/wikidata/wikidata-20190304-all.json.bz2'
ENWIKI_DUMP = 'C:/Users/Sofie/Documents/data/wikipedia/enwiki-20190320-pages-articles-multistream.xml.bz2'
ENWIKI_INDEX = 'C:/Users/Sofie/Documents/data/wikipedia/enwiki-20190320-pages-articles-multistream-index.txt.bz2'
PRIOR_PROB = 'C:/Users/Sofie/Documents/data/wikipedia/prior_prob.csv'


  # these will/should be matched ignoring case
  wiki_namespaces = ["b", "betawikiversity", "Book", "c", "Category", "Commons",
                     "d", "dbdump", "download", "Draft", "Education", "Foundation",
                     "Gadget", "Gadget definition", "gerrit", "File", "Help", "Image", "Incubator",
keep keep keep add keep keep keep keep
 poc with few entities and collecting aliases from the WP links 
examples/pipeline/wikidata_entity_linking.py