FlamingTempura / bibtex-tidy

Cleaner and Formatter for BibTeX files
https://flamingtempura.github.io/bibtex-tidy/
MIT License
871 stars 66 forks source link

Remove `null` fields #418

Closed gr4nt3d closed 2 months ago

gr4nt3d commented 12 months ago

A faulty Zotero-Export (BetterBibLaTeX) and clean-up through bibtex-tidy yields the following with fields such as doi = {null}.

Current Outcome:

@article{suttonPolicyGradientMethods1999,
    title        = {Policy Gradient Methods for Reinforcement Learning with Function Approximation},
    author       = {Sutton, Richard S. and Sutton, Richard S. and McAllester, David and Singh, Satinder and Mansour, Yishay},
    doi          = {null},
    date         = 1999,
    journaltitle = {null},
    eprint       = {null},
    eprinttype   = {pmid},
    abstract     = {Function approximation is essential to reinforcement learning, but the standard approach of approximating a value function and determining a policy from it has so far proven theoretically intractable. In this paper we explore an alternative approach in which the policy is explicitly represented by its own function approximator, independent of the value function, and is updated according to the gradient of expected reward with respect to the policy parameters. Williams's REINFORCE method and actor-critic methods are examples of this approach. Our main new result is to show that the gradient can be written in a form suitable for estimation from experience aided by an approximate action-value or advantage function. Using this result, we prove for the first time that a version of policy iteration with arbitrary differentiable function approximation is convergent to a locally optimal policy.},
    mag_id       = 2155027007,
    pmcid        = {null}
}

Expected outcome:

Fields that resolve to null should be treated as empty fields.

Side note: I am not very experienced with author listings, is it common that one author is named twice? (see above example) Should that be an issue (with my source) to fix too?

FlamingTempura commented 7 months ago

Hi @gr4nt3d, apologies it's been a while since you opened this ticket - do you remember what the input was to bibtex-tidy that triggered this outcome?

gr4nt3d commented 6 months ago

Hi @FlamingTempura my apologies for the delay as well. The input was somewhat like this:

input ```bibtex @article{suttonPolicyGradientMethods1999, title = {Policy Gradient Methods for Reinforcement Learning with Function Approximation}, author = {Sutton, Richard S. and Sutton, Richard S. and McAllester, David and Singh, Satinder and Mansour, Yishay}, date = {1999}, journaltitle = {null}, eprint = {null}, eprinttype = {pmid}, doi = {null}, abstract = {Function approximation is essential to reinforcement learning, but the standard approach of approximating a value function and determining a policy from it has so far proven theoretically intractable. In this paper we explore an alternative approach in which the policy is explicitly represented by its own function approximator, independent of the value function, and is updated according to the gradient of expected reward with respect to the policy parameters. Williams's REINFORCE method and actor-critic methods are examples of this approach. Our main new result is to show that the gradient can be written in a form suitable for estimation from experience aided by an approximate action-value or advantage function. Using this result, we prove for the first time that a version of policy iteration with arbitrary differentiable function approximation is convergent to a locally optimal policy.}, mag_id = {2155027007}, pmcid = {null}, file = {/Users/.../resources/NIPS-1999-policy-gradient-methods-for-reinforcement-learning-with-function-approximation-Paper.pdf} } ```

The input came from an betterbibtex Zotero export. I know this should be fixed on their end, but this functionality would help here none the less.

FlamingTempura commented 2 months ago

Hey @gr4nt3d, thanks for getting back.

I think that since this is due to buggy output from Zotero rather than a more general formatting issue of bibtex, it's not in scope for bibtex tidy.

Happy to reconsider if the request becomes more popular.