Skip to main content

Paper2CMap

A package that automatically generates a concept map for a PDF document using LLM.

TODO

  • Optimize concept map generating prompt
  • Add few shots for concept map generating
  • Support LNKG/CXL/SVG format output
  • Support QA based on generated concept map

Overview

What is Concept Map?

(Answerd by ChatGPT)

A concept map is a visual tool that is used to organize and represent knowledge, ideas, and information in a hierarchical or non-linear way. It is a graphical representation of a network of interconnected concepts, ideas, or themes, and the relationships between them. Concept maps are commonly used in education, particularly in fields such as science, social studies, and language arts, to help students organize and understand complex information.

Concept maps typically consist of nodes or boxes, which represent concepts or ideas, and lines or arrows, which show the relationships between the concepts. The nodes can be labeled with keywords or short phrases, and the lines or arrows can be labeled with connecting words, such as "leads to," "is a type of," or "causes."

Concept maps can be created by individuals or groups, and can be used to facilitate learning, problem-solving, decision-making, and communication. They are a flexible and powerful tool that can be adapted to many different contexts and purposes.

What is Paper2CMap?

Paper2CMap is a package that automatically generates a concept map for a PDF document using LLM. It will first cut the text of the PDF document into sections, then generate concept maps for each section, and finally merge and prune these concept maps to generate a final map for the whole document.

Currently the generated concept map is in JSON format:

[{"source": "source concept", "target": "target concept", "relationship": "relationship between source and target"}]

In future, we will support more formats export, such as LNKG/CXL/SVG.

Quick Start

Prerequisites

  • Python 3.8+
  • An OpenAI API key or Azure OpenAI Service deployment
  • Set environment variables:
    # If you are using OpenAI Official Service
    export OPENAI_API_TYPE="openai"
    export OPENAI_API_KEY="<OpenAI API Key>"
    
    # If you are using Azure OpenAI Service
    export OPENAI_API_TYPE="azure"
    export OPENAI_API_BASE="<Azure OpenAI Service Endpoint>"
    export OPENAI_API_KEY="<Azure OpenAI Service Key>"
    

Installation

You can now install Paper2CMap with pip:

pip install paper2cmap

Usage

Now you can easily generate a concept map from a PDF document within 3 lines of code:

from paper2cmap import Paper2CMap

paper2cmap = Paper2CMap(model_name="gpt-3.5-turb")
paper2cmap.load("path/to/paper.pdf")
paper2cmap.generate_cmap()

For more details of the API, please refer to API Reference.

Gradio App

We also host a Gradio App at HuggingFace Space for you to try out Paper2CMap without installing it locally. You can also deploy it to your own server:

pip install gradio
gradio app.py

License

This project is licensed under the MIT License - see the LICENSE file for details

Contributing

As an open source project, we welcome contributions and suggestions. Please follow the fork and pull request workflow to contribute to this project. Please do not try to push directly to this repo unless you are maintainer.

Contact

If you have any questions, please feel free to contact us via weitian.bnu@gmail.com

Metadata

Release files for paper2cmap 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paper2cmap 0.1.3
File Size Uploaded Provenance Actions
paper2cmap-0.1.3.tar.gz 13.2 kB Without provenance Details for paper2cmap-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for paper2cmap 0.1.3
File Interpreter ABI Platform Actions
paper2cmap-0.1.3-py3-none-any.whl Python 3 none any Details for paper2cmap-0.1.3-py3-none-any.whl

Total release size: 25.7 kB

Release files / paper2cmap-0.1.3.tar.gz

Download URL paper2cmap-0.1.3.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf56bf05ae035e45702d0b8c7b7f2796801588d9954eaa0aa905462d4d16ba57
BLAKE2b-256 checksum
How to use checksums
99314a912f68a2a15207d77990806a20befe80c1665afb9e7f2fe548e3748652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / paper2cmap-0.1.3-py3-none-any.whl

Download URL paper2cmap-0.1.3-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1e825cd32c24bc3538c0b300ce8d0683f65971873423fc1f011b09b4d62cb50
BLAKE2b-256 checksum
How to use checksums
598c4d620fad7a720bf46af20368689bd8303f6ae1329cfea631de3c79b85a95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for paper2cmap 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page