dalejn / cleanBib

Probabilistically assign gender and race proportions of first/last authors pairs in bibliography entries
MIT License
149 stars 31 forks source link

Help with cleanBib step 3 #24

Closed agcost closed 3 years ago

agcost commented 3 years ago

Hello

Please could you help, I have done steps 1 and 2, but am stuck at step 3. I get the error message:

File "", line 19 for(i in 1:nrow(names)){ ^ SyntaxError: invalid syntax

Please could you explain further what you mean in this instruction? : "NOTE: Please edit your .bib file using information printed by the code and provided in cleanedBib.csv." as I don't know what I am meant to be changing in my .bib file.

Here is my biliography file exported from Mendeley (just did 3 papers to start with), the .csv file created, and the notebook:

https://hub.gke2.mybinder.org/user/dalejn-cleanbib-v06of2ct/edit/My_Collection.bib https://hub.gke2.mybinder.org/user/dalejn-cleanbib-v06of2ct/edit/cleanedBib.csv https://hub.gke2.mybinder.org/user/dalejn-cleanbib-v06of2ct/notebooks/cleanBib.ipynb

Many thanks

dalejn commented 3 years ago

Hi, thanks for using this tool! In this step, we ask that you use the output of this box and the reference keys saved in cleanedBib.csv to delete specified entries in the .bib file. Each entry in the .bib file starts with @article{[referenceKey], title={...}, author={...}, etc}. This metadata is used to compile a bibliography and is also what we use to look for redundant entries and self-citations. So, deleting the entry would mean deleting all of @article{...} for the specified reference keys. We will work on making this step more automated.

If you continue to run into problems, could you send a Drive or Dropbox link to the saved files? It looks like those links are dead.

agcost commented 3 years ago

Hi, thanks very much for making the tool! And thanks for getting back to me :) I just tried having another go to try out what you suggested, but this time I'm being stopped at step 2 and getting an error message I wasn't getting the other day. Please could you help again? :) (sorry, its probably me doing something wrong as I'm a coding newbie).

The error message after step 2 says:

NameError Traceback (most recent call last)

in 83 bibtexparser.dump(bib_data, bibtex_file) 84 ---> 85 if os.path.exists(homedir + paper_bib_file_excl_sc): 86 ID = glob.glob(homedir + paper_bib_file_excl_sc) 87 else: NameError: name 'paper_bib_file_excl_sc' is not defined I hope these links work this time: https://www.dropbox.com/s/ed1fz8bldl05rgw/My_Collection.bib?dl=0 https://www.dropbox.com/s/crwk8wln6g1z60c/cleanBib.ipynb?dl=0 Thank you!
dalejn commented 3 years ago

Sorry, that new error is my fault. I've pushed an update and tested that this new bug should be resolved.

Thanks for sending these files! After uploading your .bib file, on step 3, I'm receiving the following message:

[1] "STOP: Please revise incomplete full first names or empty cells. Then, re-run steps 2 and 3. Here are some suggestions to check for with the following citation keys in your .bib file: " [1] "Arrubla2014"

Looking inside the .bib file, the entry starting with @article{Arrubla2014, has a last author who has an initial as their first name: "N. Jon". This confuses the algorithm because it needs a name rather than an initial. Looking up that paper and who this person is, it looks like we can replace "N. Jon" with "Nadim" in the .bib file. https://scholar.google.com/citations?user=3Aog-yIAAAAJ&hl=en

Saving the .bib file with this change and then re-running steps 2 and 3 no longer gives any warnings. So, proceeding to step 4 works as intended

agcost commented 3 years ago

Great, thanks very much for your help! Will give this a try :)