Git Product home page Git Product logo

bib-titlecase's Introduction

Bib-normalizer: normalize your BibTex

Function

  1. Capitalize the title of each reference.
  2. Remove some redundant or useless attributes. e.g., url, doi.

Requirement

  • python3

Usage

Put your .bib file under this folder (e.g., test.bib), then run the following command:

python main.py --input test.bib --output test_cap.bib

By default, it will only remain some attributes (e.g., author, title). Change line 17 in the main.py according to your need.

Demo

For example, there is a plain BibTex:

@inproceedings{simon:hal-02318233,
  TITLE = {Unsupervised Information Extraction: Regularizing Discriminative Approaches with Relation Distribution Losses},
  AUTHOR = {Simon, {\'E}tienne and Guigue, Vincent and Piwowarski, Benjamin},
  URL = {https://hal.archives-ouvertes.fr/hal-02318233},
  BOOKTITLE = {{ACL 2019 - 57th Annual Meeting of the Association for Computational Linguistics}},
  ADDRESS = {Florence, Italy},
  PUBLISHER = {{Association for Computational Linguistics}},
  PAGES = {1378-1387},
  YEAR = {2019},
  MONTH = Jul,
  DOI = {10.18653/v1/P19-1133},
  HAL_ID = {hal-02318233},
  HAL_VERSION = {v1},
}

After compiling, it looks like this below. Obviously, it is not very elegant because the first letters of some words in the title are not capitalized, and there is so much redundant information, e.g., Florence, Italy, 10.18653/v1/P19-1133.

avatar

A normalized BibTex should be like this:

@inproceedings{simon:hal-02318233,
  TITLE = {{U}nsupervised {I}nformation {E}xtraction: {R}egularizing {D}iscriminative {A}pproaches with {R}elation {D}istribution {L}osses},
  AUTHOR = {Simon, {\'E}tienne and Guigue, Vincent and Piwowarski, Benjamin},
  BOOKTITLE = {{ACL 2019 - 57th Annual Meeting of the Association for Computational Linguistics}},
  PAGES = {1378-1387},
  YEAR = {2019},
}

You can find that all words in the title are capitalized, except for the prepositions. Some useless information has been removed.

avatar

bib-titlecase's People

Contributors

renzelou avatar richard2333 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.