Package: paper2cmap
Paper2CMapA package that automatically generates a concept map for a PDF document using LLM.TODOOptimize concept map generating promptAdd few shots for concept map generatingSupport LNKG/CXL/SVG format outputSupport QA based on generated concept mapOverviewWhat 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 StartPrerequisitesPython 3.8+An OpenAI API key or Azure OpenAI Service deploymentSet environment variables:# If you are using OpenAI Official ServiceexportOPENAI_API_TYPE="openai"exportOPENAI_API_KEY="<OpenAI API Key>"# If you are using Azure OpenAI ServiceexportOPENAI_API_TYPE="azure"exportOPENAI_API_BASE="<Azure OpenAI Service Endpoint>"exportOPENAI_API_KEY="<Azure OpenAI Service Key>"InstallationYou can now install Paper2CMap with pip:pipinstallpaper2cmapUsageNow you can easily generate a concept map from a PDF document within 3 lines of code:frompaper2cmapimportPaper2CMappaper2cmap=Paper2CMap(model_name="gpt-3.5-turb")paper2cmap.load("path/to/paper.pdf")paper2cmap.generate_cmap()For more details of the API, please refer toAPI Reference.Gradio AppWe also host aGradio Appat HuggingFace Space for you to try out Paper2CMap without installing it locally. You can also deploy it to your own server:pipinstallgradio
gradioapp.pyLicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsContributingAs an open source project, we welcome contributions and suggestions. Please follow thefork and pull requestworkflow to contribute to this project. Please do not try to push directly to this repo unless you are maintainer.ContactIf you have any questions, please feel free to contact us viaweitian.bnu@gmail.com