paper2cmap


Namepaper2cmap JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummaryA package that automatically generates a concept map for a PDF document using LLM.
upload_time2023-04-23 06:25:21
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2023 Tian Wei Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords concept map cmap paper pdf chatgpt gpt llm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:
```JSON
[{"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:
    ```bash
    # 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:
```bash
pip install paper2cmap
```

### Usage

Now you can easily generate a concept map from a PDF document within 3 lines of code:
```python
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](docs/paper2cmap/paper2cmap.md).

### Gradio App

We also host a [Gradio App](https://huggingface.co/spaces/whiskyboy/paper2cmap) at HuggingFace Space for you to try out Paper2CMap without installing it locally. You can also deploy it to your own server:
```bash
pip install gradio
gradio app.py
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Contributing

As an open source project, we welcome contributions and suggestions. Please follow the [fork and pull request](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) 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>


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "paper2cmap",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "concept map,cmap,paper,pdf,chatgpt,gpt,llm",
    "author": "",
    "author_email": "weitian <weitian.bnu@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/99/31/4a912f68a2a15207d77990806a20befe80c1665afb9e7f2fe548e3748652/paper2cmap-0.1.3.tar.gz",
    "platform": null,
    "description": "# Paper2CMap\n\nA package that automatically generates a concept map for a PDF document using LLM.\n\n## TODO\n- [ ] Optimize concept map generating prompt\n- [ ] Add few shots for concept map generating\n- [ ] Support LNKG/CXL/SVG format output\n- [ ] Support QA based on generated concept map\n\n## Overview\n\n### What is Concept Map?\n\n*(Answerd by ChatGPT)*\n> 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.\n> \n> 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.\"\n> \n> 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.\n\n### What is Paper2CMap?\n\nPaper2CMap 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.\n\nCurrently the generated concept map is in JSON format:\n```JSON\n[{\"source\": \"source concept\", \"target\": \"target concept\", \"relationship\": \"relationship between source and target\"}]\n```\nIn future, we will support more formats export, such as LNKG/CXL/SVG.\n\n## Quick Start\n\n### Prerequisites\n\n- Python 3.8+\n- An OpenAI API key or Azure OpenAI Service deployment\n- Set environment variables:\n    ```bash\n    # If you are using OpenAI Official Service\n    export OPENAI_API_TYPE=\"openai\"\n    export OPENAI_API_KEY=\"<OpenAI API Key>\"\n\n    # If you are using Azure OpenAI Service\n    export OPENAI_API_TYPE=\"azure\"\n    export OPENAI_API_BASE=\"<Azure OpenAI Service Endpoint>\"\n    export OPENAI_API_KEY=\"<Azure OpenAI Service Key>\"\n    ```\n\n### Installation\n\nYou can now install Paper2CMap with pip:\n```bash\npip install paper2cmap\n```\n\n### Usage\n\nNow you can easily generate a concept map from a PDF document within 3 lines of code:\n```python\nfrom paper2cmap import Paper2CMap\n\npaper2cmap = Paper2CMap(model_name=\"gpt-3.5-turb\")\npaper2cmap.load(\"path/to/paper.pdf\")\npaper2cmap.generate_cmap()\n```\n\nFor more details of the API, please refer to [API Reference](docs/paper2cmap/paper2cmap.md).\n\n### Gradio App\n\nWe also host a [Gradio App](https://huggingface.co/spaces/whiskyboy/paper2cmap) at HuggingFace Space for you to try out Paper2CMap without installing it locally. You can also deploy it to your own server:\n```bash\npip install gradio\ngradio app.py\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Contributing\n\nAs an open source project, we welcome contributions and suggestions. Please follow the [fork and pull request](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow to contribute to this project. Please do not try to push directly to this repo unless you are maintainer.\n\n## Contact\n\nIf you have any questions, please feel free to contact us via <weitian.bnu@gmail.com>\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Tian Wei  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A package that automatically generates a concept map for a PDF document using LLM.",
    "version": "0.1.3",
    "split_keywords": [
        "concept map",
        "cmap",
        "paper",
        "pdf",
        "chatgpt",
        "gpt",
        "llm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "598c4d620fad7a720bf46af20368689bd8303f6ae1329cfea631de3c79b85a95",
                "md5": "be4378d2d4361a992dbfcacd16815337",
                "sha256": "d1e825cd32c24bc3538c0b300ce8d0683f65971873423fc1f011b09b4d62cb50"
            },
            "downloads": -1,
            "filename": "paper2cmap-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "be4378d2d4361a992dbfcacd16815337",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12534,
            "upload_time": "2023-04-23T06:25:18",
            "upload_time_iso_8601": "2023-04-23T06:25:18.404323Z",
            "url": "https://files.pythonhosted.org/packages/59/8c/4d620fad7a720bf46af20368689bd8303f6ae1329cfea631de3c79b85a95/paper2cmap-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99314a912f68a2a15207d77990806a20befe80c1665afb9e7f2fe548e3748652",
                "md5": "6dc2db7e86e5a409ba0cf479ede52e2c",
                "sha256": "bf56bf05ae035e45702d0b8c7b7f2796801588d9954eaa0aa905462d4d16ba57"
            },
            "downloads": -1,
            "filename": "paper2cmap-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "6dc2db7e86e5a409ba0cf479ede52e2c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 13164,
            "upload_time": "2023-04-23T06:25:21",
            "upload_time_iso_8601": "2023-04-23T06:25:21.677442Z",
            "url": "https://files.pythonhosted.org/packages/99/31/4a912f68a2a15207d77990806a20befe80c1665afb9e7f2fe548e3748652/paper2cmap-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-23 06:25:21",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "paper2cmap"
}
        
Elapsed time: 0.05871s