  
              line = file.readline()
              cnt += 1
  
      # only print aliases with more than one potential entity
      # TODO remove hardcoded path
      with open('C:/Users/Sofie/Documents/data/wikipedia/prior_prob.csv', mode='w', encoding='utf8') as outputfile:
          outputfile.write("alias" + "|" + "count" + "|" + "entity" + "\n")
          for alias, alias_dict in sorted(map_alias_to_link.items(), key=lambda x: x[0]):
              for entity, count in sorted(alias_dict.items(), key=lambda x: x[1], reverse=True):
                  outputfile.write(alias + "|" + str(count) + "|" + entity + "\n")
  
 
</s> remove     # TODO remove hardcoded path
    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: </s> remove     # TODO remove hardcoded path
 </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: </s> remove         return self._aliases_table.size() - 1 # not counting dummy element on index 0
 </s> add         return self._aliases_table.size() - 1 # not counting dummy element on index

    def get_alias_strings(self):
        return [self.vocab.strings[x] for x in self._alias_index][1:] # removing the dummy element on index 0
    # write all aliases and their entities and occurrences to file
    with open(PRIOR_PROB, mode='w', encoding='utf8') as outputfile:
  
              line = file.readline()
              cnt += 1
  
    # write all aliases and their entities and occurrences to file
    with open(PRIOR_PROB, mode='w', encoding='utf8') as outputfile:
    # write all aliases and their entities and occurrences to file
    with open(PRIOR_PROB, mode='w', encoding='utf8') as outputfile:
    # write all aliases and their entities and occurrences to file
    with open(PRIOR_PROB, mode='w', encoding='utf8') as outputfile:
          outputfile.write("alias" + "|" + "count" + "|" + "entity" + "\n")
          for alias, alias_dict in sorted(map_alias_to_link.items(), key=lambda x: x[0]):
              for entity, count in sorted(alias_dict.items(), key=lambda x: x[1], reverse=True):
                  outputfile.write(alias + "|" + str(count) + "|" + entity + "\n")
  
keep keep keep keep replace replace replace keep keep keep keep keep
 poc with few entities and collecting aliases from the WP links 
examples/pipeline/wikidata_entity_linking.py