I am trying to reproduce your tutorial but this is running an error.
for focal_year in tqdm.tqdm(range(2000,2011), desc = "Computing indicator for window of time"):
Foster = novelpy.indicators.Foster2015(collection_name = "Ref_Journals_sample",
id_variable = 'PMID',
year_variable = 'year',
variable = "c04_referencelist",
sub_variable = "item",
focal_year = focal_year,
starting_year = 1995,
community_algorithm = "Louvain")
Foster.get_indicator()
start: 0%| | 16/49872 [00:00<00:00, 229040.49it/s]
Computing indicator for window of time: 0%| | 0/11 [00:26<?, ?it/s]
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
1 for focal_year in tqdm.tqdm(range(2000,2011), desc = "Computing indicator for window of time"):
2 Foster = novelpy.indicators.Foster2015(collection_name = "Ref_Journals_sample",
3 id_variable = 'PMID',
4 year_variable = 'year',
(...)
8 starting_year = 1995,
9 community_algorithm = "Louvain")
---> 10 Foster.get_indicator()
File /opt/anaconda3/envs/ai_diversity/lib/python3.9/site-packages/novelpy/indicators/Foster2015.py:172, in Foster2015.get_indicator(self)
170 print("Saved ...")
171 print('Getting score per paper ...')
--> 172 self.update_paper_values()
173 print("Done !")
File /opt/anaconda3/envs/ai_diversity/lib/python3.9/site-packages/novelpy/utils/run_indicator_tools.py:436, in create_output.update_paper_values(self, **kwargs)
433 os.makedirs(self.path_output)
435 if self.indicator in ['uzzi','lee','wang','foster']:
--> 436 self.populate_list()
437 else:
438 print('''indicator must be in 'uzzi', 'foster', 'lee', 'wang' ''')
File /opt/anaconda3/envs/ai_diversity/lib/python3.9/site-packages/novelpy/utils/run_indicator_tools.py:379, in create_output.populate_list(self)
376 self.keep_diag=False
378 # Use novelty score of combination + Matrix of combi of papers to have novelty score of the paper with id_variable = idx
--> 379 self.get_paper_score()
380 else:
381 continue
File /opt/anaconda3/envs/ai_diversity/lib/python3.9/site-packages/novelpy/utils/run_indicator_tools.py:286, in create_output.get_paper_score(self)
284 scores_list = []
285 for combi in combis:
--> 286 if self.list_of_items_restricted:
287 if combi[0] in self.list_of_items_restricted and combi[1] in self.list_of_items_restricted:
288 combi = sorted( (self.name2index[combi[0]], self.name2index[combi[1]]) )
AttributeError: 'Foster2015' object has no attribute 'list_of_items_restricted'