def __init__(self, cache_path='entity_cache.p', save_every_x_queries=1):
    self.save_every_x_queries = save_every_x_queries
    self.x_queries_passed = 0
    self.languages = ['en', 'fr', 'es', 'pt', 'pt-br', 'it', 'de']
    self.cache_path = cache_path
    try:
        with open(self.cache_path, 'rb') as f:
            self.entity_cache = pickle.load(f)
    except FileNotFoundError:
        self.entity_cache = {}
def __init__(self, cache_path='entity_cache.p', save_every_x_queries=1):
    self.save_every_x_queries = save_every_x_queries
    self.x_queries_passed = 0
    self.languages = ['en', 'fr', 'es', 'pt', 'pt-br', 'it', 'de']
    self.cache_path = cache_path
    try:
        with open(self.cache_path, 'rb') as f:
            self.entity_cache = pickle.load(f)
    except FileNotFoundError:
        self.entity_cache = {}