Skip to content

Instantly share code, notes, and snippets.

View fgirbal's full-sized avatar

Francisco Eiras fgirbal

View GitHub Profile
@fgirbal
fgirbal / bibtex_cleaner.py
Last active October 9, 2024 08:47
Python script that calls an OpenAI model to clean up a references file (saving the old reference if it fails). Using `gpt-4o-mini` costs about $0.05 for cleaning a .bib file with ~400 references.
import re
import argparse
from tqdm import tqdm
import openai
from openai import OpenAI
openai.api_key = "YOUR API KEY"
client = OpenAI(api_key=openai.api_key)