parrot-gpt

Parrot GPT is a Python library that enables you to convert bibliographic metadata between various schemas using OpenAI’s large language models through its API. The library is not limited to specific schemas, but currently, some restrictions apply to input and output schemas.

https://github.com/kjgarza/parrot_gpt

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.0%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

Parrot GPT is a Python library that enables you to convert bibliographic metadata between various schemas using OpenAI’s large language models through its API. The library is not limited to specific schemas, but currently, some restrictions apply to input and output schemas.

Basic Info
  • Host: GitHub
  • Owner: kjgarza
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 1.94 MB
Statistics
  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • Open Issues: 6
  • Releases: 0
Created over 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog Contributing License Citation Authors Codemeta

README.rst

Parrot GPT
==========

|PyPI version| |Build Status| |Documentation Status| |Updates|

Parrot GPT is a Python library that enables you to convert bibliographic
metadata between various schemas using OpenAI’s large language models
through its API. The library is not limited to specific schemas, but
currently, some restrictions apply to input and output schemas.

.. figure:: docs/parrot_gpt_logo.png
   :alt: Parrot GPT logo

   Parrot GPT logo

-  License: MIT
-  Documentation: https://parrot-gpt.readthedocs.io

Metadata Formats
----------------

The following table shows some examples of metadata formats supported by
Parrot GPT:

+---------------+
| Schema        |
+===============+
| DATS          |
+---------------+
| cff           |
+---------------+
| crossref_xml  |
+---------------+
| JATS          |
+---------------+
| BioSchema     |
+---------------+
| Codemeta      |
+---------------+
| RIF-CS        |
+---------------+
| EDMI          |
+---------------+
| DCAT          |
+---------------+
| DCAT-AP       |
+---------------+
| DataCite      |
+---------------+
| DataCite-XML  |
+---------------+
| DataCite-JSON |
+---------------+
| Crossref      |
+---------------+
| schema.org    |
+---------------+
| bibtex        |
+---------------+
| DC-XML        |
+---------------+
| DC-JSON       |
+---------------+
| Dublin Core   |
+---------------+

Installation
------------

Install ``parrot_gpt`` using ``pip``:

.. code:: bash

   $ pip install parrot_gpt

Usage
-----

Command Line
~~~~~~~~~~~~

Use the cli.py script to transform metadata using a selected large language model and prompt type. Where:


- MODEL is the large language model to use (e.g., turbo, gpt3)
- PROMPT_TYPE is the type of input prompt (e.g., enrich, translate, crosswalk, peer_review)
- INPUT_FILE is the input metadata file
- OUTPUT_FILE is the output metadata file
- OPTIONS are optional arguments, such as --initial_schema, --target_schema, and --venue (for peer review)

For example:

.. code:: shell
   
   $ export OPENAI_API_KEY={OPENAI_API_KEY}
   $
   $ python -m parrot_gpt.cli --model gpt3 --prompt-type translate --input-file input.xml --output-file output.json --initial_schema crossref --target_schema datacite


Python API
~~~~~~~~~~

You can also use Parrot GPT in your Python code:

.. code:: python

   from parrot_gpt import ParrotGpt
   from parrot_gpt.model_interface import GPT3Model
   from collections import namedtuple

   Arguments = namedtuple('Arguments', 'prompt_type initial_schema target_schema')
   args = Arguments(prompt_type="translate", initial_schema="crossref", target_schema="datacite")
   input_metadata= "path/to/your/input_file"

   parrot_gpt = ParrotGpt(GPT3Model())
   output = parrot_gpt.serialize(input_metadata, args)
   print(output)




Models and Prompts
------------

The following large language models are supported:

- turbo: GPT-3.5 Model
- gpt3: GPT-3 Model

The following prompt types are supported:

- enrich: Enriches the input metadata file
- translate: Translates the metadata file to another schema
- crosswalk: Generates a crosswalk between two schemas
- peer_review: Generates a peer review report for the input file

Contributing
------------

Contributions are welcome! Please check the
`issues `__ page for any
existing discussions, or create a new one if you have any suggestions or
ideas.

License
-------

This project is licensed under the MIT License. See the
`LICENSE `__ file for details.

.. |PyPI version| image:: https://img.shields.io/pypi/v/parrot_gpt.svg
.. |Build Status| image:: https://img.shields.io/travis/kjgarza/parrot_gpt.svg
.. |Documentation Status| image:: https://readthedocs.org/projects/parrot-gpt/badge/?version=latest
.. |Updates| image:: https://pyup.io/repos/github/kjgarza/parrot_gpt/shield.svg

Owner

  • Name: Kristian Garza
  • Login: kjgarza
  • Kind: user
  • Location: Berlin

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
title: "Parrot GPT"
version: "0.2.0"
date-released: "ADD_RELEASE_DATE_HERE"
license: "MIT"
repository-code: "https://github.com/kjgarza/parrot_gpt"
url: "https://parrot-gpt.readthedocs.io"
authors:
  - family-names: "Garza"
    given-names: "Kristian"
    orcid: "https://orcid.org/0000-0003-3484-6875"

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "name": "Parrot GPT",
  "description": "A Python library for converting bibliographic metadata between different schemas using the OpenAI Large language models via its API.",
  "license": "https://opensource.org/licenses/MIT",
  "codeRepository": "https://github.com/kjgarza/parrot_gpt",
  "issueTracker": "https://github.com/kjgarza/parrot_gpt/issues",
  "programmingLanguage": "Python",
  "url": "https://parrot-gpt.readthedocs.io",
  "author": {
    "@type": "Person",
    "name": "Kristian Garza",
    "email": "kj.garza@gmail.com"
  },
  "version": "0.2.0",
  "keywords": [
    "metadata",
    "bibliographic",
    "conversion",
    "GPT",
    "OpenAI",
    "API"
  ]
}

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 5
  • Total pull requests: 5
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 1 minute
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • kjgarza (5)
Pull Request Authors
  • github-actions[bot] (2)
  • kjgarza (2)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 16 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: parrot-gpt

Python Boilerplate contains all the boilerplate you need to create a Python package.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 16 Last month
Rankings
Dependent packages count: 6.6%
Downloads: 18.6%
Average: 25.1%
Forks count: 30.5%
Dependent repos count: 30.6%
Stargazers count: 39.1%
Maintainers (1)
Last synced: 10 months ago

Dependencies

requirements.txt pypi
  • logger ==1.4
  • openai ==0.26.5
requirements_dev.txt pypi
  • Sphinx ==1.8.5 development
  • bump2version ==0.5.11 development
  • coverage ==4.5.4 development
  • flake8 ==3.7.8 development
  • logger ==1.4 development
  • openai ==0.26.5 development
  • pip ==19.2.3 development
  • tox ==3.14.0 development
  • twine ==1.14.0 development
  • watchdog ==0.9.0 development
  • wheel ==0.33.6 development
.github/workflows/hermes_githubb_to_zenodo.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • peter-evans/create-pull-request v5 composite
setup.py pypi